Bug 1383338 - await shield recipe runner so recipes have a chance to see if this is first run. r=mkelly, a=jcristau
authorRobert Helmer <rhelmer@mozilla.com>
Fri, 28 Jul 2017 13:27:30 -0700
changeset 414493 2ccefa352a999294fe5d582cd7142052deb40095
parent 414492 b5fbb13229c2aaf5938b635a8553cf52744b1320
child 414494 66bd0b4c3b50686ca081aafcc9a8c1a26b77df00
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkelly, jcristau
bugs1383338
milestone55.0
Bug 1383338 - await shield recipe runner so recipes have a chance to see if this is first run. r=mkelly, a=jcristau 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));