Re: [w3c/ServiceWorker] Don't fail update upon error fetching the incumbent worker's import s… (#1377)

jakearchibald requested changes on this pull request.

The logic here seems fine, but I'm not sure about the use of pairs. In cases like `Return |map|[|url|]'s [=/response=].` I'd expect "response" to link back to the field in the pair, rather than the fetch spec. As in, https://w3c.github.io/ServiceWorker/#ref-for-dfn-installing-worker%E2%91%A5 links to the "installing worker" field, rather than "service worker" definition.

The infra spec isn't clear here, so I've filed https://github.com/whatwg/infra/issues/234 - oh Anne just confirmed that these things are supposed to be linked.

However, there might be an easier way to do this without pairs. Instead of changing **script resource map**, add an additional field **used scripts**, which is a [set](https://infra.spec.whatwg.org/#sets) of URLs.

Instead of setting the **used flag**, add the URL to **used scripts**. When it comes to filtering the **script resource map**, you can check if the URL is in the **used scripts** set, and if it isn't, remove the entry from the **script resource map**.

This keeps the usage of **script resource map** simple, as you're not having to dig into a structure to get the response.



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/pull/1377#pullrequestreview-190738026

Received on Wednesday, 9 January 2019 14:00:57 UTC