Bug 245425

Summary: REGRESSION (Safari 16): Service worker clientId is empty for web worker fetches
Product: WebKit Reporter: Ashley Gullen <ashley>
Component: Service WorkersAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Critical CC: achristensen, ahmad.saleem792, apple-rth, ap, bfulgham, cdumez, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: All   
OS: iOS 16   
See Also: https://github.com/web-platform-tests/wpt/pull/36068
Bug Depends on:    
Bug Blocks: 254938    

Description Ashley Gullen 2022-09-20 07:09:13 PDT
Safari 16 has a regression where the Service Worker fetch event for a web worker has an empty clientId. It works correctly in Chrome and in Safari 15.

Minimal repro: https://downloads.scirra.com/labs/swworker/

Load the page. Reload it so the SW becomes active. In its fetch event it logs every fetch with its URL and clientId. Open dev tools for the service worker to see these logs.

In Safari 16+ the clientId is empty for the worker fetches. In Safari 15 and Chrome it sets the correct clientId.

This breaks a paid-for feature (Remote Preview) in our commercial web app Construct (www.construct.net). Please fix it ASAP.
Comment 1 Alexey Proskuryakov 2022-09-20 18:29:26 PDT
I only see "Hello world from worker.js" in Safari 15.6.1, so this test case doesn't confirm that this is a regression. And I'm getting the same output from STP 153.
Comment 2 Ashley Gullen 2022-09-21 04:43:25 PDT
I did check iOS 15.7 and it was working there - don't forget to open the console for the Service Worker, it's easy to get mixed up between consoles...
Comment 3 Ashley Gullen 2022-09-21 04:44:22 PDT
(and don't forget the reload step to make sure the SW is active and actually intercepting fetches)
Comment 4 Alexey Proskuryakov 2022-09-24 16:55:48 PDT
Yes, I wasn't looking at the service worker console, thank you for the clarification.

I could confirm with STP, and it worked correctly with Safari 15.6.1. Didn't try Safari 16, but it's known to be broken there per your report.
Comment 5 Radar WebKit Bug Importer 2022-09-24 16:56:00 PDT
<rdar://problem/100368228>
Comment 6 youenn fablet 2022-09-26 00:53:01 PDT
Pull request: https://github.com/WebKit/WebKit/pull/4696
Comment 7 youenn fablet 2022-09-26 01:07:35 PDT
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/36068
Comment 8 EWS 2022-09-28 00:24:06 PDT
Committed 254944@main (6facf7d89d16): <https://commits.webkit.org/254944@main>

Reviewed commits have been landed. Closing PR #4696 and removing active labels.
Comment 9 Chris Dumez 2022-09-28 13:24:31 PDT
Reverted by https://github.com/WebKit/WebKit/pull/4801
Comment 10 Chris Dumez 2022-09-28 13:24:34 PDT
Re-opening for pull request https://github.com/WebKit/WebKit/pull/4801
Comment 11 EWS 2022-09-28 13:30:09 PDT
Committed 254966@main (828a55516a7e): <https://commits.webkit.org/254966@main>

Reviewed commits have been landed. Closing PR #4801 and removing active labels.
Comment 12 Alexey Proskuryakov 2022-09-28 15:18:05 PDT
So, reopening.
Comment 13 youenn fablet 2023-01-16 06:49:42 PST
Pull request: https://github.com/WebKit/WebKit/pull/8694
Comment 14 EWS 2023-01-18 08:50:28 PST
Committed 259031@main (599d00ac6774): <https://commits.webkit.org/259031@main>

Reviewed commits have been landed. Closing PR #8694 and removing active labels.