profiler icon indicating copy to clipboard operation
profiler copied to clipboard

When installing the service worker for the first time, if the user reloads the page before it's installed, they'll see a broken notification

Open julienw opened this issue 3 years ago • 0 comments

STR:

  1. Make sure that the service worker for profiler.firefox.com isn't registered.
  2. Open profiler.firefox.com.
  3. Before the service worker is installed, reload the page.
  4. Wait a bit until the service worker is fully installed.

=> A notification appears, asking to reload the page to finish the installation. => clicking the button changes the text on the button but otherwise do nothing

Instead we should have no notification, because the installed service worker doesn't replace an old one.

This is a regression from the previous implementation using offline-plugin. I tried to debug but the flow isn't obvious, workbox is quite complicated to follow with all the modules. We may be able to workaround the issue on the frontend side (maybe checking if there's a controlling service worker before showing the notification would work?). Otherwise we can try to reproduce the issue in a smaller testcase and file a bug at workbox. And/or write our own service worker and just use workbox's InjectManifest instead of GenerateSW.

┆Issue is synchronized with this Jira Task

julienw avatar Nov 21 '22 13:11 julienw