Closed Bug 1498378 Opened 6 years ago Closed 6 years ago

Actually remove the old onboarding add-on's prefs

Categories

(Firefox :: New Tab Page, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
Firefox 64
Iteration:
64.3 - Oct 12
Tracking Status
firefox63 --- unaffected
firefox64 --- fixed

People

(Reporter: Gijs, Assigned: ursula)

References

Details

Attachments

(1 file)

From https://hg.mozilla.org/mozilla-central/rev/c452c4911daf :

     if (currentUIVersion < 54) {
-      // Migrate browser.onboarding.hidden to browser.onboarding.state.
-      if (Services.prefs.prefHasUserValue("browser.onboarding.hidden")) {
-        let state = Services.prefs.getBoolPref("browser.onboarding.hidden") ? "watermark" : "default";
-        Services.prefs.setStringPref("browser.onboarding.state", state);
-        Services.prefs.clearUserPref("browser.onboarding.hidden");
+      // Clear old onboarding prefs from profile (bug 1462415)
+      let onboardingPrefs = Services.prefs.getBranch("browser.onboarding.");
+      if (onboardingPrefs) {
+        let onboardingPrefsArray = onboardingPrefs.getChildList("");
+        for (let item of onboardingPrefsArray) {
+          Services.prefs.clearUserPref("browser.onboarding." + item);
+        }
       }


This won't work. The `currentUIVersion` is tracked in the profile, and will now be significantly higher than 54. If we want to remove these prefs, we need to increment the const at https://searchfox.org/mozilla-central/rev/1ce4e8a5601da8e744ca6eda69e782318afab54d/browser/components/nsBrowserGlue.js#2134 and add a new block at the bottom of the method that checks against the newly incremented version.
Component: New Tab Page → Activity Streams: Newtab
Thanks for the heads up - should I revert the original changes to this as well? As in, leave the block for currentUIVersion < 49 and currentUIVersion < 54 the way it used to be?
Flags: needinfo?(gijskruitbosch+bugs)
(In reply to Ursula Sarracini (:ursula) from comment #1)
> Thanks for the heads up - should I revert the original changes to this as
> well? As in, leave the block for currentUIVersion < 49 and currentUIVersion
> < 54 the way it used to be?

You can remove the old blocks entirely, as they are no longer needed for the new builds which won't have this onboarding code. You can leave behind comments saying "49/54 [respectively] was used for ..." in their places.
Flags: needinfo?(gijskruitbosch+bugs)
Note that something just landed on inbound/autoland that updated the version ( https://bugzilla.mozilla.org/show_bug.cgi?id=1479575 ), so you'll want to pick an N+1 from that new N.
Pushed by usarracini@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f1a8f5f20797
Actually remove the old onboarding add-on's prefs r=Gijs
Assignee: nobody → usarracini
Iteration: --- → 64.3 (Oct 12)
Priority: -- → P1
https://hg.mozilla.org/mozilla-central/rev/f1a8f5f20797
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 64
Component: Activity Streams: Newtab → New Tab Page
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: