[w3c/ServiceWorker] Should update() always reject if there is an installing worker? (#1429)

Currently, [section 3.2.6 (step 4)](https://www.w3.org/TR/service-workers-1/#service-worker-registration-update) of the spec mandates that calling update() rejects immediately `if the context object’s relevant settings object's global object globalObject is a ServiceWorkerGlobalScope object, and globalObject's associated service worker's state is installing` (i.e. calling update() inside the install handler rejects, compare [WPT](https://github.com/web-platform-tests/wpt/blob/master/service-workers/service-worker/update-not-allowed.https.html)).

Updating if there is a worker in `installing` state doesn't really make sense and most likely indicates that sites call `update()` too often. It may be cleaner to change the spec to always reject if there is an `installing` worker and not only from within the `installing` worker.

Given that Firefox doesn't follow the spec here and already reject updates immediately (https://bugzilla.mozilla.org/show_bug.cgi?id=1488792) and Chrome only very recently implemented the current spec (when fixing a bug that prevented updating if there was an installing worker, https://crbug.com/895845), this change shouldn't cause sites to break.

What do people think? @aliams @asutherland @jakearchibald @mattto @wanderview @youennf 

-- 
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/1429

Received on Sunday, 9 June 2019 18:28:05 UTC