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

Thinking about this more, how about this:

Instead of passing the registration to the job as an argument, we instead pass the scope.  Then, once we are in the job synchronization mechanism we pull the registration out the map again each time.  This lets us explicitly handle the case where the scope is not in the map.  For a register() operation we would create a new registration.  For an update() we would simply abort, etc.

This should allow us to avoid or explicitly handle any races around accessing the registration map.

Thoughts?

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

Received on Monday, 7 December 2015 14:40:31 UTC