From c85ec9721d0d9f9df248cfaa8ac538b719713611 Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Tue, 4 Feb 2014 21:19:19 -0800 Subject: [PATCH] Back out e78a7c6d9601 (bug 965896) for xpcshell orange --- browser/components/preferences/sync.js | 2 +- services/sync/Weave.js | 8 ++++---- services/sync/modules/service.js | 18 +----------------- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/browser/components/preferences/sync.js b/browser/components/preferences/sync.js index 6d7c7ac2db5..df6ac223813 100644 --- a/browser/components/preferences/sync.js +++ b/browser/components/preferences/sync.js @@ -85,7 +85,7 @@ let gSyncPane = { _init: function () { let topics = ["weave:service:login:error", "weave:service:login:finish", - "weave:service:start-over:finish", + "weave:service:start-over", "weave:service:setup-complete", "weave:service:logout:finish", FxAccountsCommon.ONVERIFIED_NOTIFICATION]; diff --git a/services/sync/Weave.js b/services/sync/Weave.js index 6626d5d0cfb..271865da9bd 100644 --- a/services/sync/Weave.js +++ b/services/sync/Weave.js @@ -106,10 +106,10 @@ WeaveService.prototype = { fxAccountsEnabled = !prefs.prefHasUserValue("username"); Services.prefs.setBoolPref("services.sync.fxaccounts.enabled", fxAccountsEnabled); } - // Currently we don't support toggling this pref after initialization - - // except when sync is reset - but this 1 exception is enough that we can't - // cache the value. - return fxAccountsEnabled; + // Currently we don't support toggling this pref after initialization, so + // inject the pref value as a regular boolean. + delete this.fxAccountsEnabled; + return this.fxAccountsEnabled = fxAccountsEnabled; }, observe: function (subject, topic, data) { diff --git a/services/sync/modules/service.js b/services/sync/modules/service.js index a050e587bdc..9e4c490664f 100644 --- a/services/sync/modules/service.js +++ b/services/sync/modules/service.js @@ -889,23 +889,7 @@ Sync11Service.prototype = { this.identity.deleteSyncCredentials(); - // Reset the identity manager, then re-initialize it so the FxA manager is - // used. - this.identity.username = ""; - Services.prefs.clearUserPref("services.sync.fxaccounts.enabled"); - this.status.__authManager = null; - this.identity = Status._authManager; - this._clusterManager = this.identity.createClusterManager(this); - - // Tell the new identity manager to initialize itself - this.identity.initialize().then(() => { - Svc.Obs.notify("weave:service:start-over:finish"); - }).then(null, err => { - this._log.error("startOver failed to re-initialize the identity manager: " + err); - // Still send the observer notification so the current state is - // reflected in the UI. - Svc.Obs.notify("weave:service:start-over:finish"); - }); + Svc.Obs.notify("weave:service:start-over:finish"); }, persistLogin: function persistLogin() {