Actually remove the old onboarding add-on's prefs

RESOLVED FIXED in Firefox 64

Status

()

enhancement
P1
normal
RESOLVED FIXED
7 months ago
7 months ago

People

(Reporter: Gijs, Assigned: ursula)

Tracking

Trunk
Firefox 64
Points:
---

Firefox Tracking Flags

(firefox63 unaffected, firefox64 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

7 months ago
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.
(Reporter)

Updated

7 months ago
Component: New Tab Page → Activity Streams: Newtab
(Assignee)

Comment 1

7 months ago
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)
(Reporter)

Comment 2

7 months ago
(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)
(Reporter)

Comment 3

7 months ago
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.

Comment 5

7 months ago
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

Comment 6

7 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/f1a8f5f20797
Status: NEW → RESOLVED
Last Resolved: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 64
You need to log in before you can comment on or make changes to this bug.