- From: Miles Daffin <notifications@github.com>
- Date: Thu, 02 Apr 2020 16:56:15 -0700
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 2 April 2020 23:56:28 UTC
Another year has turned... Having just spent too many hours (far too many hours) trying to get a simple update workflow working flawlessly (and I am still not there), @dfabulich's one-liner looks like heaven to me. ```javascript navigator.serviceWorker.waiting.then(alertUser); ``` Why is something that seems so simple so maddeningly complex? If there is ever an update I would like to know so I can tell the user. It might be because they pressed a 'check for updates' button. Or it might be because they launched the app and an update was found. Or some periodic background check might find an update. It doesn't matter. In all these cases I need to say: "An update has been found - would you like to use it now?" If they say yes then I need to skip waiting and reload the page when the new service worker is fully activated and in control. This has to be the most common use case of all and yet it really seems almost impossible to implement. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/ServiceWorker/issues/1222#issuecomment-608153450
Received on Thursday, 2 April 2020 23:56:28 UTC