Bug 272967
| Summary: | messageerror event doesn't fire on ServiceWorkerGlobalScope | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Philip Jägenstedt <philip> |
| Component: | Service Workers | Assignee: | youenn fablet <youennf> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | ahmad.saleem792, cdumez, mike, webkit-bug-importer, youennf |
| Priority: | P2 | Keywords: | InRadar, WPTImpact |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://github.com/web-platform-tests/wpt/pull/46003 | ||
Philip Jägenstedt
Disclaimer: I'm not totally sure about the root cause here, but something needs fixing either in WebKit, WPT, or BCD.
In BCD, the messageerror event for ServiceWorkerGlobalScope is marked as partially supported in Safari, because the event never fires:
https://github.com/mdn/browser-compat-data/blob/7752b0a038a04ee47f112e696706bd53a589b0c6/api/ServiceWorkerGlobalScope.json#L617
That refers to https://bugs.webkit.org/show_bug.cgi?id=171216, which is closed as fixed. But from the patch it's not easy to tell if the event actually fires now or not.
Turning to WPT, this test failure suggests that the event doesn't fire:
https://wpt.fyi/results/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-serviceworker-failure.https.html?run_id=5176510071177216&run_id=5153332145946624&run_id=5195972581261312&run_id=5076778648862720
The failure message points to this line of the test being reached:
https://github.com/web-platform-tests/wpt/blob/1cafd038c989f47a1e136844d09ca85a06f85ce0/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/serviceworker-failure.js#L16C27-L16C55
So my best guess is that WebKit doesn't fire the messageerror event on ServiceWorkerGlobalScope, and instead fires a message event with data being set to null.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/127104436>
Ahmad Saleem
We do have following FIXME:
FIXME: Add support for messageerror event when message deserialization fails.
https://searchfox.org/wubkat/rev/53d24706292c592556c5991a08e75e3066495105/Source/WebCore/workers/service/context/ServiceWorkerThread.cpp#149
youenn fablet
Pull request: https://github.com/WebKit/WebKit/pull/27974
youenn fablet
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/46003
EWS
Committed 278408@main (fddda893fc92): <https://commits.webkit.org/278408@main>
Reviewed commits have been landed. Closing PR #27974 and removing active labels.