Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DDP.onReconnect(), deprecate conn.onReconnect #9092

Merged
merged 4 commits into from Sep 20, 2017

Conversation

hwillson
Copy link
Contributor

@hwillson hwillson commented Sep 15, 2017

Creating a new PR to continue work on #5677 (since the original PR's branch is locked). Original PR description:

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.

Definitely still work in progress.

Fixes #5665.

brettle and others added 2 commits November 18, 2015 14:56
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`.
@hwillson
Copy link
Contributor Author

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 History.md entry. A few extra things to note:

  1. These changes are backwards compatible (even though the existing connection.onReconnect handling is mostly-broken, people still might be using it as is; for a good breakdown of why it makes sense to preserve this broken backwards compatibility, see User logging in or out overwrites onReconnect and code using onReconnect breaks resume-on-reconnect #5665 (comment)).

  2. The DDP.connect docs will have to updated after (if) this PR is merged. The onReconnect section under DDP.connect should be removed, and a new DDP.onReconnect section should be added. I'll prep a docs PR for this.

Thanks!

@hwillson hwillson changed the title [WIP] Add DDP.onReconnect(), deprecate conn.onReconnect Add DDP.onReconnect(), deprecate conn.onReconnect Sep 19, 2017
@benjamn benjamn added this to the Package Patches milestone Sep 20, 2017
@benjamn benjamn merged commit d854a4b into meteor:devel Sep 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants