Re: [slightlyoff/ServiceWorker] More clarity around waiting for an active worker to finish (#916)

I think there are a couple other places we need to check for "idle" state or no extension promises:

1) Anywhere we link to "using the service worker" should probably also check idle state.

https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#dfn-use

2) When a client is unloaded we clear the registration if the uninstalling flag is set.  We should really check for idle state there first.

We then also need to add a hook for when the active worker goes idle to clear the registration if the uninstalling flag is set and there are no controlled clients.

I discovered this because I have a bug from a user showing that we unexpectedly abort a fetch event when they race an `unregister()` against a `window.location.reload()`.  Its basically the same issue, just triggered from the `unregister()` instead of an update.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/916#issuecomment-237272060

Received on Wednesday, 3 August 2016 17:13:53 UTC