Re: [ServiceWorker] unregister() then register() same-scope, different script URL that fails: what do you expect to happen? (#396)

I also don't understand why these 2 steps are required in the new location:

    Wait until a Record {[[key]], [[value]]} entry of its scope to registration map where registration's scope url matches entry.[[key]] is deleted.
    Set a newly-created Record {[[key]]: registration's scope url, [[value]]: registration} to scope to registration map.

It seems to me the problem to be solved is:
1) If an [[Unregister]] was called before this [[ContinueInstalling]]'s (My name for step 7 of [[Install]], after waiting on the queue) matching [[Register]], we want to treat the unregister as never happening since this register replaced it. So we could just set the uninstalling flag to false.
2) Otherwise, if [[Unregister]] was called between the [[Register]] and [[ContinueInstalling]] (the worker took a long time to fetch resources or something), we want to let unregister win. Which means if the timestamp of setting unregister was later then we can just abort these steps.

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

Received on Saturday, 7 February 2015 00:01:13 UTC