Closed Bug 1688403 Opened 3 years ago Closed 3 years ago

Split migration steps for 2.53 and 2.57

Categories

(SeaMonkey :: Preferences, enhancement)

enhancement

Tracking

(seamonkey2.53+ fixed, seamonkey2.57esr? affected)

RESOLVED FIXED
seamonkey 2.84
Tracking Status
seamonkey2.53 + fixed
seamonkey2.57esr ? affected

People

(Reporter: frg, Assigned: frg)

References

Details

(Whiteboard: SM2.53.7)

Attachments

(2 files)

We have some migrations which are only needed for 2.57 and later. Currently there is only one function and one migration version pref saved in the profile. Every time we need to add a new migration step for 2.53 we currently need to sort out how to do this in both versions.

I think the easiest way is to spilt the migration into two steps one for 2.57 and up only. After 2.53 is discontinued we can merge the code back to use only one pref.

Tested on 2.57 alpha 1 pre

Attachment #9198820 - Flags: review?(iann_bugzilla)
Attachment #9198820 - Flags: approval-comm-esr60?

[Approval Request Comment]
Regression caused by (bug #): --
User impact if declined: The world will end
Testing completed (on m-c, etc.): 2.53.7
Risk to taking this patch (and alternatives if risky): trivial
String changes made by this patch: --

Attachment #9198821 - Flags: review?(iann_bugzilla)
Attachment #9198821 - Flags: approval-comm-release?
Comment on attachment 9198820 [details] [diff] [review]
1688403-migrate-257.patch

>+  _migrateUI() {
>     const UI_VERSION = 7;
This could probably be set to 5 as this is changing:

>-    if (currentUIVersion < 6) {
>+    if (currentUIVersion < 5) {

Then this comment is not needed:
>+    // Pretend currentUIVersion 6 and 7 never happened (used in 2.57 for a time).

>+    // If the pref is not set this is a new or pre SeaMonkey 2.57 profile.
>+    // We can't tell so we just run migration with version 0.
>+    let currentUIVersion2 = 0;
>+
>+    if (Services.prefs.prefHasUserValue("suite.migration2.version")) {
>+      currentUIVersion2 = Services.prefs.getIntPref("suite.migration2.version");
>+    }
You could use:
let currentUIVersion2 = Services.prefs.getIntPref("suite.migration2.version", 0);

Would it be better for the pref to be called suite.migration.version2?

r/a=me with points answered/addressed
Attachment #9198820 - Flags: review?(iann_bugzilla)
Attachment #9198820 - Flags: review+
Attachment #9198820 - Flags: approval-comm-esr60?
Attachment #9198820 - Flags: approval-comm-esr60+

Actually, ignore the 5/7 comment as we have no guarantee when this code will be run.

Comment on attachment 9198821 [details] [diff] [review]
1688403-migrate-253.patch

>     // 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");
>     }
This could become:
let currentUIVersion = Services.prefs.getIntPref("suite.migration.version",0);

r/a=me with that addressed.
Attachment #9198821 - Flags: review?(iann_bugzilla)
Attachment #9198821 - Flags: review+
Attachment #9198821 - Flags: approval-comm-release?
Attachment #9198821 - Flags: approval-comm-release+

Pushed by frgrahl@gmx.net:
https://hg.mozilla.org/comm-central/rev/930e79b1bfd8
Split migration steps for 2.53 and 2.57. r=IanN

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED

Checked in patch needed a bit of a rebase for not yet finalized/reviewed Bug 1441016

Target Milestone: --- → Future
Pushed by frgrahl@gmx.net:
https://hg.mozilla.org/comm-central/rev/f86ac06e065f
Follow-up: Fix bad versions in migration steps. rs=me
Target Milestone: Future → seamonkey 2.84
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: