Re: [w3c/ServiceWorker] "Unregister" operation may be interrupted by `ServiceWorker#postMessage` (#1146)

For this particular issue I'm thinking:
* worker.postMessage should throw InvaildStateError if worker.state is "redundant"
* If that didn't happen, postMessage should drop silently if the service worker's state (the conceptual service worker represented by |worker|)  is redundant before trying to start the worker.
* Invoking Run Service Worker on a conceptual service worker whose state is redundant should fail (or assert).

There are some related issues here like whether postMessage() should block on Run Service Worker (mentioned in #1403 ) and we generally doesn't really check to see if Run Service Worker failed (with the exception of the Update algorithm).

I'm not sure if the spec changed since the discussion on this thread, but using the registration's uninstalling flag for this doesn't seem right... we set the flag in unregister() but the service worker is still alive and usable while it has clients (so it can stop and be restarted multiple times).

-- 
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/1146#issuecomment-499371192

Received on Thursday, 6 June 2019 06:48:31 UTC