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

To sum, how about the following change?

- Move Install step 22 to Update step 1 so it look like:
```
Update algorithm
1. If registration's uninstalling flag is set, unset it.
```
- Change Handle Service Worker Client Unload step 5 back to the previous state:

If registration's uninstalling flag is set removing ~~and the result of running Get Newest Worker algorithm passing registration as the argument is null~~, invoke Clear Registration algorithm passing registration as its argument and abort these steps.

This change still resolves the OP issue as by the time `iframe.remove()` is called, the registration's uninstalling flag has been unset by `register(new_worker_url)`. But this brings a change in behavior that the registration will not be cleared when:

1. Unregister
1. Update
1. Update above failed

I like this behavior as it's simpler to reason about. Yeah, the Update is followed (and just failed).

Thoughts?

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

Received on Thursday, 10 September 2015 07:36:19 UTC