Closed Bug 1818447 Opened 2 years ago Closed 2 years ago

workers with { type: module} should not throw if module workers are disabled

Categories

(Core :: DOM: Workers, defect, P3)

defect

Tracking

()

VERIFIED FIXED
112 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox110 --- unaffected
firefox111 + verified
firefox112 --- verified

People

(Reporter: yulia, Assigned: yulia)

References

Details

Attachments

(3 files)

No description provided.
Severity: -- → S3
Status: NEW → ASSIGNED
Priority: -- → P3
Summary: Ignore rather than throw on workers with { type: module } → workers with { type: module} should not throw if module workers are disabled

I am not sure what the new behavior will be, but currently worker module support is detected by checking if the type property is accessed at all.
See https://stackoverflow.com/questions/62954570/javascript-feature-detect-module-support-for-web-workers for example.

So if the new behavior will read the type property but not throw, current implementations might assume that type: module is supported.

Thanks for the heads up. I tested the usecase there and it does work with the changes. Let me know if you run into any issues on beta.

This patch updates several tests which were incorrectly updated with the flag caused attempts to
create modules to throw. Now accessing the type no longer happens, and should address web compat
concerns.

I was surprised by which tests were turned on, but I verified them against searchfox and the tests
that were updated as part of the workers work, and this seems correct.

Depends on D170920

Duplicate of this bug: 1818732

Moving tracking from 1818732 to here.
:yulia, please nominate for beta uplift request when this lands in central and is good to uplift.
This week is the final beta week for 111, with the last beta build on Thursday 2022-03-02

Pushed by ystartsev@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/803764b6d2b9 Remove references to type() if modules pref is off; r=jonco,webidl,smaug https://hg.mozilla.org/integration/autoland/rev/faa460b11c9c Update WPT beta tests to reflect changes in module flag; r=jonco

Backed out for failures on disabled-by-permissions-policy-cross-origin.https

[task 2023-02-27T22:34:29.876Z] 22:34:29     INFO - TEST-FAIL | /web-share/disabled-by-permissions-policy-cross-origin.https.sub.html | share() is disabled explicitly by permissions policy for cross-origin iframe - assert_equals: expected "NotAllowedError" but got "Error"
[task 2023-02-27T22:34:29.876Z] 22:34:29     INFO - @https://web-platform.test:8443/web-share/disabled-by-permissions-policy-cross-origin.https.sub.html:66:20
[task 2023-02-27T22:34:29.876Z] 22:34:29     INFO - TEST-UNEXPECTED-FAIL | /web-share/disabled-by-permissions-policy-cross-origin.https.sub.html | share() not allowed, as only allowed to share with self - assert_equals: expected "NotAllowedError" but got "Error"
[task 2023-02-27T22:34:29.876Z] 22:34:29     INFO - @https://web-platform.test:8443/web-share/disabled-by-permissions-policy-cross-origin.https.sub.html:76:20
[task 2023-02-27T22:34:29.877Z] 22:34:29     INFO - ...
[task 2023-02-27T22:34:29.877Z] 22:34:29     INFO - TEST-OK | /web-share/disabled-by-permissions-policy-cross-origin.https.sub.html | took 2511ms
Flags: needinfo?(ystartsev)
Pushed by ystartsev@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/428c468be1f9 Remove references to type() if modules pref is off; r=jonco,webidl,smaug https://hg.mozilla.org/integration/autoland/rev/a15b3da16984 Update WPT beta tests to reflect changes in module flag; r=jonco

The bug is marked as tracked for firefox111 (beta). We have limited time to fix this, the soft freeze is in 9 days. However, the bug still has low priority and has low severity.

:jstutte, could you please increase the priority and increase the severity for this tracked bug? If you disagree with the tracking decision, please talk with the release managers.

For more information, please visit auto_nag documentation.

Flags: needinfo?(jstutte)
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch

Comment on attachment 9319720 [details]
Bug 1818447 - Remove references to type() if modules pref is off; r=jonco

Beta/Release Uplift Approval Request

  • User impact if declined: There will be web compat breakage and some sites using workers will not work.
  • 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: This website should work without breakage https://web.dilato.app (see 1818732) and this script should return "false" on beta: https://stackoverflow.com/questions/62954570/javascript-feature-detect-module-support-for-web-workers
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): There is some risk that some webcompat is still missing, but this hopefully got everything.
  • String changes made/needed:
  • Is Android affected?: Yes
Flags: needinfo?(ystartsev)
Attachment #9319720 - Flags: approval-mozilla-beta?
Flags: qe-verify+
Flags: needinfo?(jstutte)

Comment on attachment 9319720 [details]
Bug 1818447 - Remove references to type() if modules pref is off; r=jonco

Approved for 111.0b8

Attachment #9319720 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Regressions: 1819669
QA Whiteboard: [qa-triaged]

Reproduced the issue with 111.0b7 on Windows 10x64. The https://web.dilato.app/ webpage is not loaded and the https://stackoverflow.com/questions/62954570/javascript-feature-detect-module-support-for-web-workers script returns true value.
The issue is verified fixed with Firefox 111.0b8 on Windows 10x64, macOS 12 and Ubuntu 20.04. The https://web.dilato.app/webpage is correctly opened and the script returns false value.
On Firefox Nightly 112.0a1 (2023-02-03) the https://web.dilato.app/ webpage is correctly opened but the returned valued when running the script is true. Is this the expected behavior for Nightly? Thank you in advance!

Flags: needinfo?(ystartsev)

On Firefox Nightly 112.0a1 (2023-02-03) the https://web.dilato.app/ webpage is correctly opened but the returned valued when running the script is true. Is this the expected behavior for Nightly? Thank you in advance!

yes, this is expected as module workers are turned on by default on nightly for testing and fuzzing. Thanks for the QA work!

Flags: needinfo?(ystartsev)

(In reply to Yulia Startsev [:yulia] from comment #17)

On Firefox Nightly 112.0a1 (2023-02-03) the https://web.dilato.app/ webpage is correctly opened but the returned valued when running the script is true. Is this the expected behavior for Nightly? Thank you in advance!

yes, this is expected as module workers are turned on by default on nightly for testing and fuzzing. Thanks for the QA work!

Thank you! Closing this per the above comments.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triaged]
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: