Re: [ServiceWorker] Race when registering multiple service workers for the same scope (#783)

> So, let's remove Install step 11.4.1.5 and Install step 16.3. WDYT?

I think the issue here is that Register is touch global state outside of a synchronization mechanism.  I don't think removing steps within the synchronization mechanism is the right fix.

I think we could fix this with a few tweaks, but it really feels like we should simplify the synchronization mechanisms here.

Can we do something like this?

1. Replace registration queue, installation queue, activation queue, etc with a single per-scope work queue.
2. Every Registration, Update, Unregister, etc would get a slot in this queue.  Only one of these could ever be running at a single time.
3. Nothing that touches global state like the registration map would happen outside of the queue.

This would mean we could not be installing a SW while activating another one, but personally I think that's fine.  I don't think its worth the complexity to optimize this case and it would be better to enforce strict synchronization.

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

Received on Monday, 30 November 2015 16:54:00 UTC