Re: [ServiceWorker] Possible run-to-completion violation in "Handle Service Worker Client Unload" (#746)

> Shouldn't uninstall flag also be reset to false though?

Yes, resetting it right away seems better to reflect that instant.

> Another option is to have Update reset the flag after it has successfully installed a new worker

We're already doing so in Install step 22.1.

> Otherwise the next call to Match Service Worker Registration is going to return null because uninstalling flag is set.

Even if we reset the flag in Handle Service Worker Client Unload and Install step 22.1, I think this still can happen when Match SWR is run while the Update/Install steps are running with the registration's uninstalling flag is set. But this seems fine as Match SWR returns the result reflecting that instant. That is, if the flag is reset by the installation success later on, the subsequent Match SWR will again return the registration.

A thought just came to my mind. With the current behavior, an installation failure doesn't have a chance to reset the uninstalling flag in this scenario, meaning that the registration will be cleared. Is this desirable? Or should we reset the flag at the beginning of Update? (i.e. interpreting the update attempt always should cancel the ongoing uninstallation regardless of the result.)

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

Received on Thursday, 10 September 2015 06:50:25 UTC