Re: [w3c/ServiceWorker] Inconsistencies in ServiceWorkerClients get and matchAll implementations (Issue #1734)

> Chrome is waiting for the document to be parsed before resolving the get promise.

Yes.  Chrome wait until ServiceWorkerClient is execution ready.
https://source.chromium.org/chromium/chromium/src/+/main:content/browser/service_worker/service_worker_version.cc;l=1700;drc=fc7ddc185b7f027dd7f4981ba8b2334c69a2e79c
It should be set soon after the commit navigation IPC is sent from the browser process.  I understand the timing is just after getting all HTTP headers.
https://source.chromium.org/chromium/chromium/src/+/main:content/renderer/service_worker/service_worker_network_provider_for_frame.cc;l=48;drc=a45502c46d75f210c783e07384138379ea1e46e4

> Chrome is not exposing the resultingClientId client

Chrome is explicitly excluding it.
No other controllee case:
https://source.chromium.org/chromium/chromium/src/+/main:content/browser/service_worker/service_worker_client_utils.cc;l=609;drc=a45502c46d75f210c783e07384138379ea1e46e4
With other controllee case:
https://source.chromium.org/chromium/chromium/src/+/main:content/browser/service_worker/service_worker_client_utils.cc;l=617;drc=a45502c46d75f210c783e07384138379ea1e46e4

What I am a bit confused for Chrome implementation is that `SetControllerRegistration` is called before dispatching the fetch handler.
https://source.chromium.org/chromium/chromium/src/+/main:content/browser/service_worker/service_worker_controllee_request_handler.cc;l=456;drc=a45502c46d75f210c783e07384138379ea1e46e4
Then, if there is other clients, will we see the client with the resulting client id?

@hiroshige-g recently touched the code around this area.  Let me listen to your thoughts.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1734#issuecomment-2456512594
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/ServiceWorker/issues/1734/2456512594@github.com>

Received on Tuesday, 5 November 2024 08:19:23 UTC