Re: [w3c/ServiceWorker] ready promise is kind of weird with overlapping scopes (#1278)

> If I understand correctly, both accesses have to resolve to the same result, as they return the same promise (similar to my comment on #1279)

Sure, but which result?  There are two possibilities AFAICT:

1. The second `.ready` access waits for the first access's parallel steps to complete.  So the first access determines the result.
2. The second `.ready` access starts a second set of parallel steps and its a race to see which one completes first.

I think (1) is objectively better, but the spec kind of says (2) right now.  I think these steps need to set some kind of flag on the context object indicating "ready promise is being processed" and then make step 1 early abort if that is set:

https://w3c.github.io/ServiceWorker/#navigator-service-worker-ready

Making step 1 wait for settled creates the potential for two sets of parallel steps that race each other.

-- 
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/issues/1278#issuecomment-364946910

Received on Monday, 12 February 2018 14:57:59 UTC