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

I think we can just add "Wait for all the tasks queued by Update Worker State invoked in this algorithm to have executed." to after Step 15 of Activate. There's similar verbiage elsewhere and I think it matches the intent of the algorithm as wanderview asks in https://github.com/w3c/ServiceWorker/issues/1187#issuecomment-326582954. So this way, in the common case, the order will be:

1. 'activate' event handler runs
1. ServiceWorker#state is set to 'activated'
1. skipWaiting() promise resolves

(so 2 and 3 are flipped from https://github.com/w3c/ServiceWorker/issues/1187#issuecomment-326488845)



-- 
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#issuecomment-397940023

Received on Monday, 18 June 2018 04:38:56 UTC