Bug 1483017 - Ensure Sync is initialized before disconnecting. r=tcsc, a=RyanVM
authorMark Hammond <mhammond@skippinet.com.au>
Wed, 29 Aug 2018 01:29:19 +0000
changeset 481097 4493cbfb68bb1491845cfd6a852c24f210e26c3d
parent 481096 16acf2b6e2314e84636a9146fbe45579778f1d3f
child 481098 839a4297d51ef6776aa0ca0075e5229a4fce0553
push id1766
push userryanvm@gmail.com
push dateThu, 30 Aug 2018 13:32:16 +0000
treeherdermozilla-release@e04f8217f3c4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcsc, RyanVM
bugs1483017
milestone62.0
Bug 1483017 - Ensure Sync is initialized before disconnecting. r=tcsc, a=RyanVM MozReview-Commit-ID: 8987f26wH16 Differential Revision: https://phabricator.services.mozilla.com/D4276
services/sync/modules/SyncDisconnect.jsm
--- a/services/sync/modules/SyncDisconnect.jsm
+++ b/services/sync/modules/SyncDisconnect.jsm
@@ -115,16 +115,17 @@ this.SyncDisconnectInternal = {
     }
   },
 
   async doSyncAndAccountDisconnect(shouldUnlock) {
     // We do a startOver of Sync first - if we do the account first we end
     // up with Sync configured but FxA not configured, which causes the browser
     // UI to briefly enter a "needs reauth" state.
     let Weave = this.getWeave();
+    await Weave.Service.promiseInitialized;
     await Weave.Service.startOver();
     await fxAccounts.signOut();
     // Sync may have been disabled if we santized, so re-enable it now or
     // else the user will be unable to resync should they sign in before a
     // restart.
     Weave.Service.enabled = true;
 
     // and finally, if we managed to get the lock before, we should unlock it