Open Bug 1514030 Opened 2 years ago Updated 2 years ago

Apparent service worker activation failure

Categories

(Core :: DOM: Service Workers, defect, P3)

64 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: jeffy, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36

Steps to reproduce:

https://github.com/GoogleChrome/workbox/issues/1783 contains a full set of reproduction steps as well as screenshots showing Firefox's behavior during the process.

I'm also attaching an archive of a project that could be run locally to reproduce the failure state—make changes to, e.g., src/views/Home.vue and then rebuild to trigger the service worker updates.

To summarize the steps here:
1) Host the project on a web server that returns a 200 OK with the contents of /index.html whenever a URL that's unknown is requested. (E.g. https://github.com/zeit/serve with the -s command line flag.)
2) Deploy a service worker that loads in a URL via importScripts(), and allow it to activate on a Firefox client.
3) Make changes to the service worker file so that it pulls in a different URL via importScripts().
4) Make sure that the old URL that was pulled in via importScripts() is no longer present, and fetching it will result in a 200 OK for the index.html contents.
5) Deploy those changes and reload the page that has registered the SW.
6) Firefox will attempt to check for updates to the initial URL for the imported script, and get back the index.html contents, which it correctly logs as an error (see https://drive.google.com/file/d/1SfrKJGWd1DIXyJHMTKWIJd6WwghemcX2/view)
7) After closing an reopening the page, the activation of the updated service worker appears to fail due to an internal error in Firefox, logging an empty error message in the JS console (see the first entry in the log at https://user-images.githubusercontent.com/5196813/49836792-42ae8e80-fda4-11e8-9d85-de9424de0c4d.png).

Apologies that this description is pretty involved and potentially hard to reproduce, but that GitHub issue (https://github.com/GoogleChrome/workbox/issues/1783) does have a bunch of relevant steps/details. I can also reproduce it fairly consistently, so if it comes to it, I can try to grab some local logs/debugging info during a local repro.


Actual results:

Due to the activation step failing, the updated service worker re-enters the install phase (this behavior is confirmed by https://github.com/w3c/ServiceWorker/issues/1372).


Expected results:

Service worker activation shouldn't fail.
Component: Untriaged → DOM: Service Workers
Product: Firefox → Core
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.