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 issueRegularly, 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:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top 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 >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
I’d like to take a shot at it quickly.
Just ran into this again. Automatic refresh would be amazing and probably solves 99% of the issues caused by outdated SWs!