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

Projects
None yet
4 participants
@hwillson
Member

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 some commits Nov 18, 2015

Fix bug #5665: add DDP.onReconnect(), deprecate conn.onReconnect
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

This comment has been minimized.

Member

hwillson commented Sep 19, 2017

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 #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 from [WIP] Add DDP.onReconnect(), deprecate conn.onReconnect to 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

11 checks passed

CLA Author has signed the Meteor CLA.
Details
ci/circleci: Get Ready Your tests passed on CircleCI!
Details
ci/circleci: Group 0 Your tests passed on CircleCI!
Details
ci/circleci: Group 1 Your tests passed on CircleCI!
Details
ci/circleci: Group 2 Your tests passed on CircleCI!
Details
ci/circleci: Group 3 Your tests passed on CircleCI!
Details
ci/circleci: Group 4 Your tests passed on CircleCI!
Details
ci/circleci: Group 5 Your tests passed on CircleCI!
Details
ci/circleci: Group 6 Your tests passed on CircleCI!
Details
ci/circleci: Group 7 Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment