From b7d23f83853aa92dbb12b5ec39cca97248dc8b01 Mon Sep 17 00:00:00 2001 From: Mark Hammond Date: Thu, 30 Jan 2014 00:22:55 -0800 Subject: [PATCH] Bug 965461 - ensure sync itself and sync prefs pane considers we are logged in after key fetch. r=ttaubert --- browser/components/preferences/sync.js | 5 ++++- services/sync/modules/browserid_identity.js | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/browser/components/preferences/sync.js b/browser/components/preferences/sync.js index 5b80cbbf22f8..53e57fe7bd73 100644 --- a/browser/components/preferences/sync.js +++ b/browser/components/preferences/sync.js @@ -127,7 +127,10 @@ let gSyncPane = { fxaLoginStatus.selectedIndex = FXA_LOGIN_UNVERIFIED; enginesListDisabled = true; // So we think we are logged in, so login problems are next. - } else if (Weave.Status.login != Weave.LOGIN_SUCCEEDED) { + // (Although if the Sync identity manager is still initializing, we + // ignore login errors and assume all will eventually be good.) + } else if (Weave.Service.identity.readyToAuthenticate && + Weave.Status.login != Weave.LOGIN_SUCCEEDED) { fxaLoginStatus.selectedIndex = FXA_LOGIN_FAILED; enginesListDisabled = true; // Else we must be golden! diff --git a/services/sync/modules/browserid_identity.js b/services/sync/modules/browserid_identity.js index d14475825f94..133cb5fb242f 100644 --- a/services/sync/modules/browserid_identity.js +++ b/services/sync/modules/browserid_identity.js @@ -127,6 +127,7 @@ this.BrowserIDManager.prototype = { this._shouldHaveSyncKeyBundle = true; // and we should actually have one... this.whenReadyToAuthenticate.resolve(); this._log.info("Background fetch for key bundle done"); + Weave.Service.verifyLogin(); }).then(null, err => { this._shouldHaveSyncKeyBundle = true; // but we probably don't have one... this.whenReadyToAuthenticate.reject(err);