Closed Bug 1990252 Opened 1 year ago Closed 1 year ago

Fix train-hop compatibility to 143 and 144 caused by missing discoverystream.optIn-region-weather-config and discoverystream.optIn-locale-weather-config prefs

Categories

(Firefox :: New Tab Page, defect)

defect

Tracking

()

RESOLVED FIXED
145 Branch
Tracking Status
firefox-esr140 --- unaffected
firefox143 --- unaffected
firefox144 --- unaffected
firefox145 --- fixed

People

(Reporter: mconley, Assigned: rhamoui)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 external file)

Bug 1988925 landed which added new prefs for controlling the display of an opt-in for the weather widget. The patch did all of the right things by adding the preferences to both firefox.js AND ActivityStream's PREFS_CONFIG map.

Unfortunately, it also added a showWeatherOptIn dynamic pref, which is based on the user's geo / locale. That gets computed [here] in _updateDynamicPrefs, but that occurs before default prefs has a chance to initialize and insert the default pref values in that showWeatherOptIn relies on.

Swapping the order of these two broke other things. I'm not entirely sure what the solution is here just yet.

Set release status flags based on info from the regressing bug 1988925

:rhamoui, since you are the author of the regressor, bug 1988925, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

So looks like the old pattern of adding region/loale-config prefs in firefox.js isn't going to work with train hopping.

I totally missed this.

I think we need to hard code these in ActivityStream.sys.mjs.

Something like this?

function showWeatherOptIn({ geo, locale }) {
  return (
    csvHasValue("DE,GB,FR,ES,IT,CH,AT,BE,IE,NL,PL,CZ,SE,SG,HU,SK,FI,DK,NO,PT", geo) &&
    csvHasValue("fr,de", locale)
  );
}

csvHasValue is made up, you don't have to use that, it was just for a quick example.

I think then we can just delete the prefs for "discoverystream.optIn-region-weather-config" and "discoverystream.optIn-locale-weather-config" from both ActivityStream.sys.mjs and firefox.js

I also suspect we need to move browser.newtabpage.activity-stream.discoverystream.region-weather-config and browser.newtabpage.activity-stream.discoverystream.locale-weather-config to hard coded values too.

Again because of train hopping.

Also cc'ing maxx for visibility.

Assignee: nobody → rhamoui
Status: NEW → ASSIGNED
Pushed by mcrawford@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/3e679215d89d https://hg.mozilla.org/integration/autoland/rev/eb833c7800da Remove dynamic region prefs for Weather Opt-in trainhop fix. r=home-newtab-reviewers,mconley
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 145 Branch
Flags: needinfo?(rhamoui)
QA Whiteboard: [qa-triage-done-c146/b145]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: