Re: [w3c/ServiceWorker] Editorial: Queue a task to resolve/reject promise or when fire an event. (PR #1755)

@yoshisatoyanagisawa commented on this pull request.



> @@ -1479,20 +1483,21 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
         1. If the [=ServiceWorkerGlobalScope/service worker=] is not an <a>active worker</a>, return a <a>promise</a> rejected with an "{{InvalidStateError}}" {{DOMException}}.
         1. Let |promise| be a new <a>promise</a>.
         1. Run the following substeps <a>in parallel</a>:
-            1. For each [=/service worker client=] |client| where the result of running [=obtain a storage key=] given |client| [=storage key/equals=] the [=ServiceWorkerGlobalScope/service worker=]'s [=containing service worker registration=]'s [=service worker registration/storage key=]:
-                1. If |client|'s [=environment/execution ready flag=] is unset or |client|'s [=discarded flag=] is set, [=continue=].
-                1. If |client| is not a [=secure context=], [=continue=].
-                1. Let |storage key| be the result of running [=obtain a storage key=] given |client|.
-                1. Let |registration| be the result of running <a>Match Service Worker Registration</a> given |storage key| and |client|'s <a>creation URL</a>.
-                1. If |registration| is not the [=ServiceWorkerGlobalScope/service worker=]'s <a>containing service worker registration</a>, [=continue=].
-
-                    Note: |registration| will be null if the [=ServiceWorkerGlobalScope/service worker=]'s [=containing service worker registration=] is [=service worker registration/unregistered=].
-
-                1. If |client|'s <a>active service worker</a> is not the [=ServiceWorkerGlobalScope/service worker=], then:
-                    1. Invoke <a>Handle Service Worker Client Unload</a> with |client| as the argument.
-                    1. Set |client|'s <a>active service worker</a> to [=ServiceWorkerGlobalScope/service worker=].
-                    1. Invoke <a>Notify Controller Change</a> algorithm with |client| as the argument.
-            1. Resolve |promise| with undefined.
+            1. [=Queue a task=] to run the following steps on the [=ServiceWorkerGlobalScope/service worker=]'s [=responsible event loop=] using the [=DOM manipulation task source=]:

Why this case put "For each [=/service worker client=] |client| where..." inside the queue while the `get(id)` is not?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/pull/1755#pullrequestreview-2620072359
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/ServiceWorker/pull/1755/review/2620072359@github.com>

Received on Monday, 17 February 2025 05:39:59 UTC