Bug 1370736 - reset the sync login status after an FxA login event. r=eoger
authorMark Hammond <mhammond@skippinet.com.au>
Wed, 07 Jun 2017 16:41:18 +1000
changeset 410991 8df2372798c595fb7bb4f4ee187408036d76c26b
parent 410990 c46606ac60c8ce5a07798aa63e4717f54cc14e5e
child 410992 08c4a4446432639d2ca9de1a7c4b671e7ba94b5d
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerseoger
bugs1370736
milestone55.0a1
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
Bug 1370736 - reset the sync login status after an FxA login event. r=eoger MozReview-Commit-ID: 6BLj6q8z79i
services/sync/modules/browserid_identity.js
--- a/services/sync/modules/browserid_identity.js
+++ b/services/sync/modules/browserid_identity.js
@@ -250,16 +250,21 @@ this.BrowserIDManager.prototype = {
     // new one.
     this._token = null;
   },
 
   observe(subject, topic, data) {
     this._log.debug("observed " + topic);
     switch (topic) {
     case fxAccountsCommon.ONLOGIN_NOTIFICATION: {
+      // If our existing Sync state is that we needed to reauth, clear that
+      // state now - it will get reset back if a problem persists.
+      if (Weave.Status.login == LOGIN_FAILED_LOGIN_REJECTED) {
+        Weave.Status.login = LOGIN_SUCCEEDED;
+      }
       // 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.