Add DDP.onReconnect(), deprecate conn.onReconnect #9092
Creating a new PR to continue work on #5677 (since the original PR's branch is locked). Original PR description:
Definitely still work in progress.
Deprecate use of `connection.onReconnect = func`. Instead, a new `DDP.onReconnect(callback)` method should be used to register callbacks to call when a connection reconnects. The connection that is reconnecting is passed as the only argument to `callback`. This is used by the accounts system to relogin on reconnects without interfering with other code which uses `connection.onReconnect`.
Hi all - we should be good to go here (ready for review), so I'll remove the WIP prefix. If anyone is interested in a quick overview of this issue and the fix, see the updated