Remove "external" flavor of workbox-window events
See original GitHub issueLibrary Affected: workbox-window
Browser & Platform: Chrome 72
Issue or Feature Request Description:
If the service worker update is triggered from within the app using ServiceWorkerRegistration.update() instead of automatically at page load then the workbox-window
events don’t work as they normally do, breaking the update mechanism which otherwise works as expected when used with normal app re-launch.
This would be useful for long-running devices where the trigger for a version check can be pushed out (e.g. by the device subscribing to firebase, having a notification sent etc…)
Will try to create a simplified reproduction.
Issue Analytics
- State:
- Created 4 years ago
- Comments:20 (9 by maintainers)
Top Results From Across the Web
workbox-window - Chrome Developers
A module that helps with registering a service worker, managing updates, and responding to lifecycle events.
Read more >Ultimate Guide to PWAs with Workbox
This post is a complete guide to building a Progressive Web App (PWA) from the beginning using Google's Workbox. By the end of...
Read more >wVN - River Thames Conditions
Carlon old work box installation, Kotgarh map, Very happy new year images, Empresa limpieza mullor barcelona! Oederaner lauftag, Subway's jared raided.
Read more >Configuring quasar.config.js
vendor, Object, Add/remove files/3rd party libraries to/from vendor chunk: ... or 'kebab' (default) or 'combined' // For special cases outside of where ...
Read more >Relay
Relay encourages you to call loadQuery in response to an event, ... n \u002F\u002F Remove this when webpack adds a warning or an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The problem seems to be, that the behaviour in case of ServiceWorkerRegistration.update() is not deterministic. Sometimes it works as expected (resulting in a ‘waiting’ event) while in other cases an ‘externalwaiting’ event is triggered instead. Couldn’t reproduce that consistently (so it’s pretty hard to test), but it primarily happens, when the page was offline for a while (by devtools or server shutdown) and became online again.
In retrospect, I wonder if the
externalwaiting
vs.waiting
distinction exposed inworkbox-window
has ended up being a net-positive for developers.Perhaps moving forward, coalescing both into a single (presumably new) event would make sense? The separate events could still be maintained for backwards compatibility.
Alternatively, maybe we need to update our recipes to add in listeners for both
waiting
andexternalwaiting
, where we execute the same event handler for both.