Re: [w3c/ServiceWorker] Update shouldn't fail due to MIME check or 404 for the incumbent's worker scripts (#1374)

Proposal: When spidering |newestWorker|'s script resource map, always write the response into |updatedResourceMap|. On MIME failure, network error, or byte-for-byte body diff, set |hasUpdatedResources| to true. This ensures the diff translates into starting the installing worker, which is correct since the worker scripts are different. When the installing worker does importScripts() a MIME failure or network failure will throw SecurityError/NetworkError so in effect the installation will usually fail. We also need to remove unused resources from the installing worker's map that ended up not being used, or these will be used in the next update check against this new worker. So augment the script resource map with a flag about whether the script was loaded. After installation finishes, drop unused scripts from the map.

-- 
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/issues/1374#issuecomment-448472472

Received on Wednesday, 19 December 2018 05:17:55 UTC