question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove "external" flavor of workbox-window events

See original GitHub issue

Library 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:closed
  • Created 4 years ago
  • Comments:20 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
alex-stumpflcommented, Sep 18, 2019

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.

2reactions
jeffposnickcommented, Feb 12, 2020

In retrospect, I wonder if the externalwaiting vs. waiting distinction exposed in workbox-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 and externalwaiting, where we execute the same event handler for both.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found