Re: [w3c/ServiceWorker] Clients.get: block on reserved clients. (#1315)

jakearchibald requested changes on this pull request.



> @@ -1148,6 +1148,11 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
         1. Run these substeps <a>in parallel</a>:
             1. For each [=/service worker client=] |client| whose [=service worker client/origin=] is the <a lt="same origin">same</a> as the associated [=ServiceWorkerGlobalScope/service worker=]'s [=environment settings object/origin=]:
                 1. If |client|'s [=environment/id=] is not |id|, continue to the next iteration of the loop.
+                1. If |client|'s [=environment/execution ready flag=] is unset, then:
+                    1. Wait for the [=/HTTP fetch=] steps using the [=/request=] that |client| is the associated [=request/reserved client=] of to finish.

This seems a bit hand-wavey, since there isn't an explicit connection between a client & it's fetch.

Adding this connection would likely be really hard, since fetch doesn't really return an instance (this has been a problem [elsewhere](https://github.com/whatwg/fetch/issues/536#issuecomment-330482027)).

Feels like it would be easier to turn the *execution ready flag* into an enum, eg *execution state*, which could be "pending", "ready" or "failed". Then, this part of the spec would be explicit, as you'd be waiting for that enum to change to "failed" (in which case you'd reject and abort) or "ready" (in which case you'd continue).

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

Received on Tuesday, 29 May 2018 12:38:49 UTC