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

mattto commented on this pull request.

Thanks, that makes things clearer and I found some bugs. Revised, please take another look.

>          1. If |response|’s [=response/cache state=] is not "`local`", set |registration|’s [=service worker registration/last update check time=] to the current time.
-        1. [=Extract a MIME type=] from the |response|'s [=response/header list=]. If this MIME type (ignoring parameters) is not a [=JavaScript MIME type=], return a [=network error=].
-        1. If |response|'s [=response/type=] is not "`error`", and |response|'s [=response/status=] is an <a>ok status</a>, then:
-            1. [=map/Set=] |serviceWorker|'s [=script resource map=][|request|'s [=request/url=]] to |response|.
-            1. Set |serviceWorker|'s [=classic scripts imported flag=].

Note: The unsafe response extraction, MIME check, and error check was redundant with https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-classic-worker-imported-script, which this algorithm runs inside of by hooking into its step 2 "perform the fetch".

We also need to store the response regardless of error, in order to make it visible for update checks. E.g., the next worker might fix one of these importScripts, and that should trigger update.

-- 
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-192987975

Received on Wednesday, 16 January 2019 06:27:27 UTC