Hi Sean, thanks for the code review!
As to re-attaching event listeners[1], I agree that putting a specialized hook into BaseController.msg seems bad. I have an alternate idea[2] that puts the re-attachment in an authenticate method. I am not proposing this as the solution, but I hope this sparks the idea for another way to handle re-attachment.
I'd like to find a better option, but the trouble is that there's multiple methods for authenticating to a Controller. In particular there's three that come to mind...
1. Using the Controller's authenticate() method. 2. Using stem.connection's authenticate() function. 3. Using the BaseController's msg() function to send an 'AUTHENTICATE' request.
Your suggestion of moving the hook to Controller.authenticate() just covers the first. Mine covers all three but feels a bit icky. Suggestions welcome! -Damian