Bug 226638 - Implement FetchEvent.replacesClientId
Summary: Implement FetchEvent.replacesClientId
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Service Workers (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar, WPTImpact
Depends on:
Blocks:
 
Reported: 2021-06-04 03:01 PDT by Jake Archibald
Modified: 2023-11-12 07:16 PST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jake Archibald 2021-06-04 03:01:55 PDT
This was renamed in 2018 (https://github.com/w3c/ServiceWorker/pull/1333) but no bug was filed with WebKit, sorry about that. Anyway, this is that bug. I don't expect the rename to cause problems in the wild.

Test to fail if targetClientId is present https://github.com/web-platform-tests/wpt/pull/29213.
Comment 1 Philip Jägenstedt 2021-06-04 07:08:23 PDT
As part of sorting out many errors in the browser compat data for FetchEvent in https://github.com/mdn/browser-compat-data/pull/10774, I noticed that no browser has shipped replacesClientId yet.
Comment 2 Radar WebKit Bug Importer 2021-06-11 03:02:29 PDT
<rdar://problem/79189580>
Comment 3 youenn fablet 2022-01-11 04:21:08 PST
WebKit exposes targetClientId so I guess we should do the migration to replacesClientId even if no other browser supports it. We can deal with this as part of bug 190313
Comment 4 Sam Sneddon [:gsnedders] 2022-06-06 06:44:34 PDT
targetClientId was removed in bug 235107, but replacesClientId wasn't implemented.
Comment 5 Gregory Terzian 2023-04-18 02:27:48 PDT
Can I please tackle this one? 

I've tried to follow the flow; is it correct that one should add a String, say "m_replacesClientIdentifier", to the "NetworkResourceLoader" in the network process, and do something similar to what is currently done with "m_resultingClientIdentifier"(propagate it all the way to where the "FetchEvent" is created in "ServiceWorkerFetch" within WebCore)?
Comment 6 youenn fablet 2023-04-18 02:36:53 PDT
You are more than welcome to contribute :)

This bug might not be the easiest bug to tackle if this is your first WebKit contribution given there is probably few existing tests and no browser is implementing it yet: https://wpt.fyi/results/service-workers/idlharness.https.any.serviceworker.html?label=experimental&label=master&aligned

The principle would be to add to new ScriptExecutionContextIdentifier member to either FetchOptions or ResourceLoaderOptions.
See resultingClientId as an example.
Comment 7 Gregory Terzian 2023-04-18 22:04:33 PDT
Great! 

A quick search indeed did not reveal any wpt test, but there is again the example of testing for the presence of resultingClientId(https://github.com/web-platform-tests/wpt/blob/0a40de7a4db9e52cdb0fc436173640756740c9e3/service-workers/service-worker/fetch-event.https.html#L129)

Thanks for the additional info, I will start looking into this.
Comment 8 Gregory Terzian 2023-04-24 20:38:25 PDT
Pull request: https://github.com/WebKit/WebKit/pull/13130