[w3c/ServiceWorker] skipWaiting() promise should resolve after promotion to .active (#1187)

As spec'd the skipWaiting() promise doesn't seem really useful. I think it might be an oversight.

I'd expect the promise to resolve after the worker has been promoted to .active and has state 'activating'.

But currently the spec is:
2. Invoke Try Activate with service worker's containing service worker registration.
3. Resolve promise with undefined.

And Try Activate early returns in some cases:
- existing active worker is still activating
- the existing active worker has pending events

So if Try Activate early returned, we resolve the promise before activating.

Also am I parsing this sentence correctly: "The result of running Service Worker Has No Pending Events with registration’s active worker is true, and no service worker client is using registration or registration’s waiting worker's skip waiting flag is set." means "A && (B || C)" where A = "no pending events", B = "no client" and C = "skip waiting flag".

-- 
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/1187

Received on Thursday, 17 August 2017 08:02:48 UTC