Drew Willcoxon 3be98f74fd Bug 1740818 - Wait for the urlbar Nimbus feature to be initialized before updating the Firefox Suggest scenario and performing pref migrations. r=nanj
The problem here is a race: Even though the user is enrolled in the online
scenario via Nimbus, the Nimbus urlbar variables may not be initialized by the
time we migrate Suggest preferences on startup. The data-collection pref is set
when we [migrate prefs](https://searchfox.org/mozilla-central/rev/df6434d2ebfdf2b5f89f205fc81d60d64a774fe1/browser/components/urlbar/UrlbarPrefs.jsm#872) -- and only there --
so we're not hitting that path like we should be. That's because the scenario
can still be the default value of "offline".

Fortunately the Nimbus client API gives us a ready promise we can await that is
resolved when the feature is loaded and ready, so all we need to do is await it
before trying to update the scenario and do migrations.

Differential Revision: https://phabricator.services.mozilla.com/D131065
2021-11-15 16:25:52 +00:00
..