Race condition when data-l10n attributes are updated when customize mode is in the foreground
Categories
(Core :: Internationalization, defect)
Tracking
()
People
(Reporter: tgiles, Assigned: emilio)
References
Details
(Keywords: regression)
Attachments
(2 files)
48 bytes,
text/x-phabricator-request
|
dmeehan
:
approval-mozilla-beta+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
dmeehan
:
approval-mozilla-beta+
|
Details | Review |
It appears that L10nMutations
reliance on nsRefreshDriver
can cause a race condition when the customize mode page is in the foreground causing background tabs to lose the ability to dynamically update their strings. This bug comes from https://bugzilla.mozilla.org/show_bug.cgi?id=1856572#c11 where :mconley found the underlying issue. (If this needs to be duplicated back to the blocking bug, feel free to do so).
STR:
- Navigate to Firefox View
- Right-click in the toolbar and select Customize Toolbar
- Navigate back to Firefox View and either open the migration wizard (if available) or go to Open Tabs, open the submenu, and hover/activate the "Move Tab" option
ER:
- Strings are translated correctly
AR:
- Translated strings are missing
Additional STR from the blocked bug (works on Mac):
- Visit about:preferences, and scroll to the "Tabs" section
- Open the devtools for the page, and paste in this script and press enter:
let changeCount = 0;
let node = document.querySelector("#warnOnQuitKey");
setInterval(() => {
node.setAttribute("data-l10n-args", JSON.stringify({"quitKey":changeCount}))
changeCount++;
}, 1000);
- Notice that the "Confirm before quitting" string is having a number increment once a second.
- Here's where experience playing Guitar Hero comes in - you have to time it so that you enter customize mode just as the number is about to change.
- Exit customize mode, and notice how the number has stopped incrementing. If you open up the DevTools, however, you'll notice that the data-l10n-args attribute is being updated still. This might take a few tries, but I can do it fairly consistently with one or two attempts.
I think this bug belongs here but please move to a more appropriate spot as needed.
Updated•1 year ago
|
Comment 1•1 year ago
|
||
Actually, I suppose this bug has always existed, bug 1842809 just made it obvious with customize mode.
Assignee | ||
Updated•1 year ago
|
Comment 2•1 year ago
|
||
This bug has been marked as a regression. Setting status flag for Nightly to affected
.
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 3•1 year ago
|
||
This doesn't fix the bug but seems worth doing. I can't think of any
reason why this null-check would be needed.
Assignee | ||
Comment 4•1 year ago
|
||
This is the actual bug fix.
If we were an observer of a detached refresh driver, we won't observe
the new one.
Depends on D190574
Comment 6•1 year ago
|
||
Hey emilio,
I think the Firefox View gang was hoping to have the issue in bug 1856572 (which is caused by this bug) fixed within Firefox 119. This patch stack seems fairly minimal - do you think we'd be safe to request an uplift for it?
Assignee | ||
Comment 7•1 year ago
|
||
Comment on attachment 9357618 [details]
Bug 1857622 - Make sure to get the new refresh driver when getting a new presshell. r=smaug
Beta/Release Uplift Approval Request
- User impact if declined: bug 1856572
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: comment 0 or bug 1856572.
- List of other uplifts needed: none
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): trivial-ish fix. Note that I didn't include a test in the hopes that :tgiles had one ready but I should add test coverage for this otherwise. Still shouldn't block uplift, it's a fairly low-risk fix.
- String changes made/needed: none
- Is Android affected?: No
Assignee | ||
Updated•1 year ago
|
Comment 8•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/483fb312c27a
https://hg.mozilla.org/mozilla-central/rev/fcde87df3b93
Comment 9•1 year ago
|
||
Comment on attachment 9357617 [details]
Bug 1857622 - Remove a useless null-check. r=smaug
Approved for 119.0b9
Comment 10•1 year ago
|
||
Comment on attachment 9357618 [details]
Bug 1857622 - Make sure to get the new refresh driver when getting a new presshell. r=smaug
Approved for 119.0b9
Comment 11•1 year ago
|
||
uplift |
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 12•1 year ago
|
||
Verified as fixed in Firefox 120.0a1 and Firefox 119.0b9 Windows 10x64, macOS 14 and Ubuntu 18.
Updated•1 year ago
|
Description
•