-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should update() always reject if there is an installing worker? #1429
Comments
Thanks Yannic. Let me merge this with #1155 to keep discussion in one place. |
On second thought, let me close that one and keep this one. The other one was about whether to reject if called from an installing worker, this is about whether to reject when there is any installing worker, even if called from another context. |
For history, discussions about this step were at: #800 #1155 In my opinion, it's easy to avoid calling update() in an installing worker. It's harder to avoid calling update() when there is any installing worker, so throwing can be surprising and you'll end up with code like: I'm feeling now update() when there is an installing worker should just be coalesced into that ongoing job and dropped silently without triggering a new update. |
Agreed. |
Merging |
Currently, section 3.2.6 (step 4) 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).Updating if there is a worker in
installing
state doesn't really make sense and most likely indicates that sites callupdate()
too often. It may be cleaner to change the spec to always reject if there is aninstalling
worker and not only from within theinstalling
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
The text was updated successfully, but these errors were encountered: