Bug 1366593 - Don't run old migration code every time at startup, only when suite.migration.version doesn't exist yet. r=frg
authorrsx11m <rsx11m.pub@gmail.com>
Tue, 23 May 2017 11:07:46 -0500
changeset 21584 849228c56d57b0a9f82f3df7d0a19df0bc413f1b
parent 21583 bd34d80df5ff4929617aaede1ec44230f54d65f7
child 21585 e4103af6a8014354a4d98d30106652f646c7bb17
push id13148
push userrsx11m.pub@gmail.com
push dateTue, 23 May 2017 16:07:43 +0000
treeherdercomm-central@849228c56d57 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfrg
bugs1366593
Bug 1366593 - Don't run old migration code every time at startup, only when suite.migration.version doesn't exist yet. r=frg
suite/common/src/nsSuiteGlue.js
--- a/suite/common/src/nsSuiteGlue.js
+++ b/suite/common/src/nsSuiteGlue.js
@@ -346,18 +346,16 @@ SuiteGlue.prototype = {
     }
     this._copyDefaultProfileFiles();
   },
 
   // profile startup handler (contains profile initialization routines)
   _onProfileStartup: function()
   {
     this._migrateUI();
-    this._updatePrefs();
-    this._migrateDownloadPrefs();
     migrateMailnews(); // mailnewsMigrator.js
 
     Sanitizer.checkSettings();
     Sanitizer.doPendingSanitize();
 
     if (Services.prefs.prefHasUserValue("privacy.sanitize.didShutdownSanitize")) {
       Services.prefs.clearUserPref("privacy.sanitize.didShutdownSanitize");
       // We need to persist this preference change, since we want to
@@ -369,30 +367,34 @@ SuiteGlue.prototype = {
                           .createInstance(Components.interfaces.nsITimer);
     timer.init(this, 3000, timer.TYPE_ONE_SHOT);
   },
 
   _migrateUI: function()
   {
     const UI_VERSION = 2;
 
-    // If the pref is not set this is a new or pre SeaMonkey 2.50 profile.
+    // If the pref is not set this is a new or pre SeaMonkey 2.49 profile.
     // We can't tell so we just run migration with version 0.
     let currentUIVersion = 0;
 
     if (Services.prefs.prefHasUserValue("suite.migration.version")) {
       currentUIVersion = Services.prefs.getIntPref("suite.migration.version");
     }
 
     if (currentUIVersion >= UI_VERSION)
       return;
 
-    // Migrate remote content exceptions for email addresses which are
-    // encoded as chrome URIs.
     if (currentUIVersion < 1) {
+      // Run any migrations due prior to 2.49.
+      this._updatePrefs();
+      this._migrateDownloadPrefs();
+
+      // Migrate remote content exceptions for email addresses which are
+      // encoded as chrome URIs.
       let permissionsDB =
         Services.dirsvc.get("ProfD", Components.interfaces.nsILocalFile);
       permissionsDB.append("permissions.sqlite");
       let db = Services.storage.openDatabase(permissionsDB);
 
       try {
         let statement = db.createStatement(
           "select origin, permission from moz_perms where " +