Bug 1383338 - await shield recipe runner so recipes have a chance to see if this is first run r?mkelly draft
authorRobert Helmer <rhelmer@mozilla.com>
Fri, 28 Jul 2017 13:27:30 -0700
changeset 617669 e0258974978fc74f897a92ba58b266b2b77099a8
parent 617496 16ffc1d05422a81099ce8b9b59de66dde4c8b2f0
child 639872 eebc2f0d67f765bd7b70ad0ae9af005b45aaefc8
push id71118
push userrhelmer@mozilla.com
push dateFri, 28 Jul 2017 20:39:54 +0000
reviewersmkelly
bugs1383338
milestone56.0a1
Bug 1383338 - await shield recipe runner so recipes have a chance to see if this is first run r?mkelly MozReview-Commit-ID: BAmWPQ3buaH
browser/extensions/shield-recipe-client/lib/RecipeRunner.jsm
--- a/browser/extensions/shield-recipe-client/lib/RecipeRunner.jsm
+++ b/browser/extensions/shield-recipe-client/lib/RecipeRunner.jsm
@@ -52,20 +52,20 @@ this.RecipeRunner = {
       // Run right now in dev mode
       this.run();
     }
 
     if (prefs.getBoolPref(FIRST_RUN_PREF)) {
       // Run once immediately after the UI is available. Do this before adding the
       // timer so we can't end up racing it.
       const observer = {
-        observe: (subject, topic, data) => {
+        observe: async (subject, topic, data) => {
           Services.obs.removeObserver(observer, UI_AVAILABLE_NOTIFICATION);
 
-          this.run();
+          await this.run();
           this.registerTimer();
           prefs.setBoolPref(FIRST_RUN_PREF, false);
 
           Services.obs.notifyObservers(null, SHIELD_INIT_NOTIFICATION);
         },
       };
       Services.obs.addObserver(observer, UI_AVAILABLE_NOTIFICATION);
       CleanupManager.addCleanupHandler(() => Services.obs.removeObserver(observer, UI_AVAILABLE_NOTIFICATION));