Closed
Bug 1467695
Opened 6 years ago
Closed 6 years ago
System theme is not applied in the browser when enabled while a static theme is active
Categories
(WebExtensions :: Themes, defect, P2)
Tracking
(firefox-esr52 unaffected, firefox-esr60 unaffected, firefox61 unaffected, firefox62 verified, firefox63 verified)
VERIFIED
FIXED
mozilla63
Tracking | Status | |
---|---|---|
firefox-esr52 | --- | unaffected |
firefox-esr60 | --- | unaffected |
firefox61 | --- | unaffected |
firefox62 | --- | verified |
firefox63 | --- | verified |
People
(Reporter: LexaSV, Assigned: kmag)
References
Details
(Keywords: regression)
Attachments
(3 files)
366.57 KB,
image/gif
|
Details | |
59 bytes,
text/x-review-board-request
|
aswan
:
review+
lizzard
:
approval-mozilla-beta+
|
Details |
560.10 KB,
image/gif
|
Details |
[Affected versions]: - Firefox 62.0a1(20180607220114) [Affected Platforms]: - Windows 10x64 [Steps to reproduce]: 1. Log in to AMO-dev 2. Go to a static theme details page and install it (i.e. https://addons-dev.allizom.org/en-US/firefox/addon/pattern-for-st-11/) 3. Go to about:addons - Themes - and look at the list of available themes 4. With the static theme still being your active theme, click on 'Enable' for a system theme (i.e. Dark) 5. Check the theme applied in the browser [Expected results]: The Dark theme is applied in the browser [Actual results]: The Default theme is applied in the browser Notes: Reproduced only when enabling a predefined system theme (i.e Light or Dark) while a static theme is active
Updated•6 years ago
|
Keywords: regression
Comment 1•6 years ago
|
||
This is due to theme code that applies an "empty" theme when a theme is uninstalled: https://searchfox.org/mozilla-central/rev/c621276fbdd9591f52009042d959b9e19b66d49f/toolkit/components/extensions/parent/ext-theme.js#321-323 This code used to run synchronously during the switch from a static theme to a LWT, but in bug 1461146 enabling and disabling became asynchronous so this code can accidentally run after the new theme has been applied. Jared, you originally wrote that unload() code. Since we have the invariant that exactly one theme is always active, a theme can only be disabled when another one is being simultaneously enabled. If we agree that the new theme just takes over and the old one doesn't have to do any cleanup, our lives will be much simpler. The alternative is to fix the theme update plumbing to fully wait for the old theme to disable before enabling the new one, but that code is still pretty hairy as a legacy of the days of complete themes. I'd certainly prefer the first option. Am I overlooking some reason that wouldn't work?
Component: Add-ons Manager → WebExtensions: Themes
Flags: needinfo?(jaws)
Comment hidden (mozreview-request) |
Comment 3•6 years ago
|
||
mozreview-review |
Comment on attachment 8984564 [details] Bug 1467695: Wait for async disable operations to finish when calling addonChanged listeners. https://reviewboard.mozilla.org/r/250440/#review257656 ::: toolkit/mozapps/extensions/AddonManager.jsm:1536 (Diff revision 1) > + if (result) { > + await result; > + } do you need the if? i thought await on a primitive value like null or undefined was effectively a no-op
Attachment #8984564 -
Flags: review?(aswan) → review+
Assignee | ||
Comment 4•6 years ago
|
||
mozreview-review-reply |
Comment on attachment 8984564 [details] Bug 1467695: Wait for async disable operations to finish when calling addonChanged listeners. https://reviewboard.mozilla.org/r/250440/#review257656 > do you need the if? i thought await on a primitive value like null or undefined was effectively a no-op Calling `await` always makes a trip through the microtask queue. If the value you `await` isn't a promise, it just gets passed through `Promise.resolve` and turned into one: js> async function meh() { print("a"); await null; print("b"); } meh(); print("c"); a c b It *probably* doesn't make a difference in this case, but this way is less risky.
Comment 5•6 years ago
|
||
(In reply to Andrew Swan [:aswan] (on PTO until 6/25) from comment #1) > This is due to theme code that applies an "empty" theme when a theme is > uninstalled: > https://searchfox.org/mozilla-central/rev/ > c621276fbdd9591f52009042d959b9e19b66d49f/toolkit/components/extensions/ > parent/ext-theme.js#321-323 > > This code used to run synchronously during the switch from a static theme to > a LWT, but in bug 1461146 enabling and disabling became asynchronous so this > code can accidentally run after the new theme has been applied. > > Jared, you originally wrote that unload() code. Since we have the invariant > that exactly one theme is always active, a theme can only be disabled when > another one is being simultaneously enabled. If we agree that the new theme > just takes over and the old one doesn't have to do any cleanup, our lives > will be much simpler. The alternative is to fix the theme update plumbing > to fully wait for the old theme to disable before enabling the new one, but > that code is still pretty hairy as a legacy of the days of complete themes. > I'd certainly prefer the first option. Am I overlooking some reason that > wouldn't work? I'm not sure how the timing will work for themes that have background scripts. That might be the only thing to be concerned about. If we can rule that out then I think the first option would work.
Flags: needinfo?(jaws)
Updated•6 years ago
|
Product: Toolkit → WebExtensions
Updated•6 years ago
|
Priority: -- → P2
Comment 6•6 years ago
|
||
Kris, is this patch in a state ready to land?
Flags: needinfo?(kmaglione+bmo)
Assignee | ||
Comment 7•6 years ago
|
||
Yup, sorry. I have too many balls in the air right now...
Assignee: nobody → kmaglione+bmo
Flags: needinfo?(kmaglione+bmo)
Assignee | ||
Comment 8•6 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/46e5404ad50cf39cfe8b10bbd9c45b4325d95d6e Bug 1467695: Wait for async disable operations to finish when calling addonChanged listeners. r=aswan
Comment 9•6 years ago
|
||
Backed out for failing browser chrome at browser/base/content/test/general/browser_compacttheme.js and xpcshell at toolkit/mozapps/extensions/test/xpcshell/test_LightweightThemeManager.js Push that caused the failures: https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&revision=46e5404ad50cf39cfe8b10bbd9c45b4325d95d6e Failure logs: bc: https://treeherder.mozilla.org/logviewer.html#?job_id=185279189&repo=mozilla-inbound&lineNumber=1950 xpcshell: https://treeherder.mozilla.org/logviewer.html#?job_id=185279452&repo=mozilla-inbound&lineNumber=1877 Backout: https://hg.mozilla.org/integration/mozilla-inbound/rev/efa8bcee4bdf153e9b9393e633e55c800a0f41d5
Flags: needinfo?(kmaglione+bmo)
Assignee | ||
Comment 10•6 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/c0ebdd0be6ba6f9748690d0ae5479977e2ea54bb Bug 1467695: Wait for async disable operations to finish when calling addonChanged listeners. r=aswan
Comment 11•6 years ago
|
||
Backed out for failing browser chrome at browser/components/customizableui/test/browser_1007336_lwthemes_in_customize_mode.js Push that caused the failures: https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&revision=c0ebdd0be6ba6f9748690d0ae5479977e2ea54bb Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=185290884&repo=mozilla-inbound&lineNumber=2371 Backout: https://hg.mozilla.org/integration/mozilla-inbound/rev/9f2138cef6ab5bdc24abaca087c1d0c0c0a1e300
Assignee | ||
Comment 12•6 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/510b02c8eb4c30437fd06058a6d46b827f0f1d78 Bug 1467695: Wait for async disable operations to finish when calling addonChanged listeners. r=aswan
Comment 13•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/510b02c8eb4c
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox63:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Reporter | ||
Comment 14•6 years ago
|
||
Verified fixed with Nightly 63.0a1 (Build ID 20180629100106) Windows 10x64
Status: RESOLVED → VERIFIED
Reporter | ||
Comment 15•6 years ago
|
||
Comment 16•6 years ago
|
||
Hi Kris, are you considering having this patch uplifted to 62 beta or can I change the tracking flag for Firefox 62 from affected to wontfix and let it ride the trains? Thanks
Updated•6 years ago
|
status-firefox61:
--- → unaffected
status-firefox-esr52:
--- → unaffected
status-firefox-esr60:
--- → unaffected
Comment 17•6 years ago
|
||
If this is an edge case it might be better to let this ride with 63. Mike, what do you think?
Flags: needinfo?(mdeboer)
Updated•6 years ago
|
Comment 18•6 years ago
|
||
This patch looks low-risk to me and fixes a regression in 62 - so I'd take it if Andrew and/ or Kris agrees.
Blocks: 1461146
Flags: needinfo?(mdeboer) → needinfo?(aswan)
Comment 19•6 years ago
|
||
I agree this is low risk. I'm pretty sure this patch doesn't depend on any other patches that aren't in 62, but it would be good for Kris to confirm that.
Flags: needinfo?(aswan)
Updated•6 years ago
|
Flags: needinfo?(kmaglione+bmo)
Updated•6 years ago
|
Flags: needinfo?(kmaglione+bmo)
Assignee | ||
Comment 20•6 years ago
|
||
Comment on attachment 8984564 [details] Bug 1467695: Wait for async disable operations to finish when calling addonChanged listeners. Approval Request Comment [Feature/Bug causing the regression]: Bug 1461146 [User impact if declined]: This prevents users from switching between WebExtension themes and lightweight themes such as the built-in compact and dark themes. [Is this code covered by automated tests?]: Yes [Has the fix been verified in Nightly?]: Yes [Needs manual test from QE? If yes, steps to reproduce]: No [List of other uplifts needed for the feature/fix]: None [Is the change risky?]: No [Why is the change risky/not risky?]: It's a pretty trivial change that just waits for async operations to finish before starting operations which conflict with them. [String changes made/needed]: None
Flags: needinfo?(kmaglione+bmo)
Attachment #8984564 -
Flags: approval-mozilla-beta?
Comment 21•6 years ago
|
||
Comment on attachment 8984564 [details] Bug 1467695: Wait for async disable operations to finish when calling addonChanged listeners. Fix for regression in 62, sounds low risk from several developers' judgement. Let's uplift for beta 16.
Attachment #8984564 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
Comment 22•6 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-beta/rev/0fc394c42009
Flags: in-testsuite+
Reporter | ||
Comment 23•6 years ago
|
||
Verified fixed in Beta 62.0b20 (20180823143155) with Win10x64 and macOS High Sierra 10.13.2
Reporter | ||
Updated•6 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•