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

Understood your concern. So it was between the first install and the second update.

> End result is we lose the registration of script B.

I think the result would be what we expected as the second job's worker (script A) would be the waiting worker at the end. The rationale that I relied on to not break the state is the second install will never run before the first install completes. So the second job's worker will be the final waiting worker. (registration's last update check time is the only state that Update algorithm updates.)

But I admit that this is subtle and not easy to reason about. Also there can be behavior mismatch when the second update aborts in the example scenario: the spec says the first job will continue and make script A be the waiting worker but Chrome may have already doomed the first job when the second update is running.

I'm leaning toward adopting a single job queue. I believe that's what Chrome currently does and what @wanderview wanted if that behavior can be spec'ed.

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

Received on Thursday, 17 December 2015 01:58:57 UTC