Data collection can be disabled when upgrading Firefox after having opted in to online
Categories
(Firefox :: Address Bar, defect, P1)
Tracking
()
People
(Reporter: adw, Assigned: adw)
References
Details
Attachments
(1 file)
48 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
RyanVM
:
approval-mozilla-release+
|
Details | Review |
Carmen and her team caught a bug shown in this video where you opt in to online, upgrade Firefox, and then the data collection toggle is off but it should be on.
STR:
- Start with 94.0.1
- Set
nimbus.debug=true
- Enroll in the offline vs. online treatment branch (i.e., online)
- Restart
- Verify the opt-in modal appears
- Click Allow suggestions
- Verify both Fx Suggest checkboxes are checked in about:prefs
- Quit
- Start Nightly with the same profile
- Open about:preferences#privacy
Actual: Data collection toggle is off
Expected: Data collection toggle should be on
QA was able to reproduce this only on a couple of Ubuntu 20.04 machines but not on other Linux machines or Windows or Mac.
I can't reproduce it on Ubuntu 20.04.3 LTS or Mac, but I think I see how it could happen. It's a technical problem due to timing. You have to be unlucky to hit it, but I can't say how how likely it is. It's not related to Ubuntu or your platform and I bet if you tried it on enough machines you'd eventually hit it on Windows or Mac too. Carmen mentioned that when the problem happens, browser.search.region
is not present before step 4, but I don't think that's related either.
Technical description below:
I think the problem is due to a race: The Nimbus urlbar feature may not be initialized by the time we migrate Suggest preferences. The data collection pref is set here -- and only here -- so we're not hitting that path like we should be. I think that's because scenario
is "offline" instead of "online" because the Nimbus urlbar feature hasn't finished initializing. When I add an artificial delay right before this line in the Nimbus client implementation, then I can reproduce it. i.e., add this right before the await this._store.load()
:
const { setTimeout } = ChromeUtils.import(
"resource://gre/modules/Timer.jsm"
);
await new Promise(r => setTimeout(r, 3000));
Assignee | ||
Comment 1•3 years ago
|
||
Assignee | ||
Comment 2•3 years ago
|
||
Carmen, I'm guessing you're more likely to hit this on slow machines, especially with slow disks. Would you say your two Ubuntu machines/VMs are slower or have slower disks than your others?
Could you please try the following builds? I made them for all platforms just in case but I know you said it only happens on Linux.
- Linux: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/DpAqUY3aQdGDcrACHJHLbQ/runs/0/artifacts/public/build/target.tar.bz2
- Windows: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/FTd3GTpDSb2dvjas7t8Exw/runs/0/artifacts/public/build/target.zip
- Mac: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/ZuiBVcQwQnuqSuHIKGiitA/runs/0/artifacts/public/build/target.dmg
Here's the Treeherder link for the builds in case you need it.
These builds won't fix profiles that have already hit the problem, but they should prevent it in the first place.
If the problem still happens, then could you please open the browser console, filter on messages with "XXXadw", and copy-paste them here?
Comment 3•3 years ago
|
||
- Yes, the Ubuntu machines are indeed slower compared to the other machines where we did not encounter this issue.
- Following the STR and the try-build provided in comment 2 fixes the issue: the data collection toggle is now on and the
browser.urlbar.quicksuggest.dataCollection.enabled
pref is correctly set totrue
.
Assignee | ||
Comment 4•3 years ago
|
||
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 -- 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.
Pushed by dwillcoxon@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5727efb9600d Wait for the urlbar Nimbus feature to be initialized before updating the Firefox Suggest scenario and performing pref migrations. r=nanj
Comment 6•3 years ago
|
||
bugherder |
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 7•3 years ago
|
||
Comment on attachment 9250548 [details]
Bug 1740818 - Wait for the urlbar Nimbus feature to be initialized before updating the Firefox Suggest scenario and performing pref migrations.
Beta/Release Uplift Approval Request
- User impact if declined: We need this for the Firefox Suggest preferences redesign targeting 95/94.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: Please see the comments here in the bug
- List of other uplifts needed: Please see uplift spreadsheet: https://docs.google.com/spreadsheets/d/1LavihS-VOPFYEyum7mrx6FKXmuQeHi9xQHfGNSxjnoY/edit?usp=sharing
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): This is a one-line change that fixes a timing-related bug. This code path is covered by automated tests, but this bug specifically does not have a test because it's difficult to make one.
- String changes made/needed:
Updated•3 years ago
|
Comment 8•3 years ago
|
||
Comment on attachment 9250548 [details]
Bug 1740818 - Wait for the urlbar Nimbus feature to be initialized before updating the Firefox Suggest scenario and performing pref migrations.
Approved for 95 beta 8, thanks.
Comment 9•3 years ago
|
||
bugherder uplift |
Assignee | ||
Comment 10•3 years ago
|
||
[Tracking Requested - why for this release]: We need this for the Firefox Suggest preferences redesign targeting 95/94.
Assignee | ||
Comment 11•3 years ago
|
||
Comment on attachment 9250548 [details]
Bug 1740818 - Wait for the urlbar Nimbus feature to be initialized before updating the Firefox Suggest scenario and performing pref migrations.
Beta/Release Uplift Approval Request
- User impact if declined: We need this for the Firefox Suggest preferences redesign targeting 95/94.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: Please see the comments here in the bug
- List of other uplifts needed: Please see uplift spreadsheet: https://docs.google.com/spreadsheets/d/1LavihS-VOPFYEyum7mrx6FKXmuQeHi9xQHfGNSxjnoY/edit?usp=sharing
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): This is a one-line change that fixes a timing-related bug. This code path is covered by automated tests, but this bug specifically does not have a test because it's difficult to make one.
- String changes made/needed:
Comment 12•3 years ago
|
||
- I have verified this bug on the latest Nightly 96.0a1 (Build ID: 20211116212601), Beta 95.0b8 (Build ID: 20211116185800) and 94.0.2 try build (Build ID: 20211115193242) on the two Ubuntu 20.04 x64 machines where the issue was previously reproduced.
- The data collection toggle is now ON and the
browser.urlbar.quicksuggest.dataCollection.enabled
pref is correctly set totrue
for the following scenarios:
- Opt in to
online
scenario -> Upgrade Firefox -> Data collection toggle is ON - Enroll in experiment -> Select
Not now
option from modal -> manually checkContextual suggestions
option -> Upgrade Firefox -> Data collection toggle is ON
Updated•3 years ago
|
Comment 13•3 years ago
|
||
Comment on attachment 9250548 [details]
Bug 1740818 - Wait for the urlbar Nimbus feature to be initialized before updating the Firefox Suggest scenario and performing pref migrations.
Approved for 94.0.2.
Comment 14•3 years ago
|
||
bugherder uplift |
Comment 15•2 years ago
|
||
- I have verified this bug on the Firefox 94.0.2 candidate build (Build ID: 20211117154346) on the two Ubuntu 20.04 x64 machines where the issue was previously reproduced.
- The data collection toggle is now ON and the
browser.urlbar.quicksuggest.dataCollection.enabled
pref is correctly set totrue
for the following scenarios:
- Opt in to
online
scenario -> Upgrade Firefox -> Data collection toggle is ON - Enroll in experiment -> Select
Not now
option from modal -> manually checkContextual suggestions
option -> Upgrade Firefox -> Data collection toggle is ON.
Description
•