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.

When we fail processing a published profile because its version is too high, we should check if the service worker has updated

See original GitHub issue

Regularly, when we increase the processed profile version, then it could happen that a user will get an error when trying to display a shared profile with this newer version, while he still has an outdated version of perf-html cached locally by the service worker.

If we have an error while processing the downloaded profile, we can check if we have a new service worker waiting, using something like:

navigator.serviceWorker.ready.then(registration => // check registration.waiting)

Or dispatch an action for onUpdated in https://github.com/devtools-html/perf.html/blob/f9d3c2e425d5124d1a9e4844cd662eff0ab3ebe0/src/index.js#L14-L18 so that we know a new SW is ready to be used.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
julienwcommented, Nov 21, 2018

I’d like to take a shot at it quickly.

0reactions
digitaraldcommented, Nov 20, 2018

Just ran into this again. Automatic refresh would be amazing and probably solves 99% of the issues caused by outdated SWs!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling Service Worker updates – how to keep the app ...
Not applying the Service Worker update might mean that our outdated Service Worker runs for ages and serves our users with assets from...
Read more >
Let Users Know When You Have Updated Your Service ...
“The default behavior is to conservatively keep the updated service worker in the 'waiting' state. This means that users will end up seeing...
Read more >
Handling service worker updates with immediacy
When a waiting service worker is found, this code informs the user that an updated version of the site is available and prompts...
Read more >
Synchronize and update a PWA in the background
Using a service worker, a Progressive Web App (PWA) can do work in the background, even when the user isn't using the app....
Read more >
The service worker lifecycle - web.dev
This state is called "waiting", and it's how the browser ensures that only one version of your service worker is running at a...
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