author | Wes Kocher <wkocher@mozilla.com> |
Wed, 15 Feb 2017 15:02:59 -0800 | |
changeset 343148 | 06f837d52004d87dcc376ebf513aa321109736f2 |
parent 343147 | 5cc18343abddfcd0700378a89b656374a732e407 |
child 343149 | 53680343b6a21cb89981dd583f31b0ee72253995 |
push id | 31371 |
push user | cbook@mozilla.com |
push date | Thu, 16 Feb 2017 12:15:11 +0000 |
treeherder | mozilla-central@8c8b54b13be7 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | backout |
bugs | 1321740 |
milestone | 54.0a1 |
backs out | 174570c9ca6b0cbe2aa8de2a1fe21e1cf4db977a |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/services/sync/modules/browserid_identity.js +++ b/services/sync/modules/browserid_identity.js @@ -249,43 +249,28 @@ this.BrowserIDManager.prototype = { // authentication header, we will notice the lack of the token and fetch a // new one. this._token = null; }, observe(subject, topic, data) { this._log.debug("observed " + topic); switch (topic) { - case fxAccountsCommon.ONLOGIN_NOTIFICATION: { + case fxAccountsCommon.ONLOGIN_NOTIFICATION: // This should only happen if we've been initialized without a current // user - otherwise we'd have seen the LOGOUT notification and been // thrown away. // The exception is when we've initialized with a user that needs to // reauth with the server - in that case we will also get here, but - // should have the same identity, and so we pass `false` into - // initializeWithCurrentIdentity so that we won't do a full sync for our - // first sync if we can avoid it. + // should have the same identity. // initializeWithCurrentIdentity will throw and log if these constraints // aren't met (indirectly, via _updateSignedInUser()), so just go ahead // and do the init. - let firstLogin = !this.username; - this.initializeWithCurrentIdentity(firstLogin); - - if (!firstLogin) { - // We still want to trigger these even if it isn't our first login. - // Note that the promise returned by `initializeWithCurrentIdentity` - // is resolved at the start of authentication, but we don't want to fire - // this event or start the next sync until after authentication is done - // (which is signaled by `this.whenReadyToAuthenticate.promise` resolving). - this.whenReadyToAuthenticate.promise.then(() => { - Services.obs.notifyObservers(null, "weave:service:setup-complete", null); - Weave.Utils.nextTick(Weave.Service.sync, Weave.Service); - }); - } - } break; + this.initializeWithCurrentIdentity(true); + break; case fxAccountsCommon.ONLOGOUT_NOTIFICATION: Weave.Service.startOver(); // startOver will cause this instance to be thrown away, so there's // nothing else to do. break; case fxAccountsCommon.ON_ACCOUNT_STATE_CHANGE_NOTIFICATION: