Re: [ServiceWorker] Have clients.claim() wait until controllers have changed before resolving (#799)

Well, I think .ready() resolves as soon as the active worker is set.  This is before the activate event is even dispatched.  The SW running the activate event is already set as registration.active.  So I don't think we can conceivably wait for the activate event's waitUntil() to resolve to get the effect you were expecting.

Also FWIW, the clients.claim() spec seems buggy at the moment.  For example, it says Handle Service Worker Client Unload should be run for each client in parallel.  This algorithm, however, does things like:

* If registration's uninstalling flag is set, invoke Clear Registration algorithm passing registration as its argument and abort these steps.
* If registration's waiting worker is not null, run Activate algorithm, or its equivalent, with registration as the argument.

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/799#issuecomment-163773748

Received on Thursday, 10 December 2015 22:38:03 UTC