You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
with the inspector opened, unregister the service worker (or do that in the console if u prefer)
the service worker is now flagged as deleted
if u just reload 1 of the tab, the reloaded tab will not be controlled, but the service worker is not flagged as deleted anymore
note that it's not like a new service worker is installed, the "id" displayed in the inspector is the same
this is why I say it's resurrected
This of course makes it hard to properly unregister a service worker unless u reload all the clients.
This is what I'm doing, but I wonder if this bug can still happen if a client reload with a bit of delay, leading to the old service worker resurrection.
The text was updated successfully, but these errors were encountered:
with the inspector opened, unregister the service worker (or do that in the console if u prefer)
the service worker is now flagged as deleted
if u just reload 1 of the tab, the reloaded tab will not be controlled, but the service worker is not flagged as deleted anymore
note that it's not like a new service worker is installed, the "id" displayed in the inspector is the same
this is why I say it's resurrected
This of course makes it hard to properly unregister a service worker unless u reload all the clients. This is what I'm doing, but I wonder if this bug can still happen if a client reload with a bit of delay, leading to the old service worker resurrection.
Hi! If that helps you I've found a way to refresh the SW in all open tabs after it is deregistered.
You send a message command to the service-worker to self-destroy, and the service-worker in turn reloads all controlled clients.
// service-worker codeself.addEventListener('message',({ data })=>{if(data==='unregister'){self.registration.unregister().then(()=>self.clients.matchAll()).then(clients=>clients.forEach(client=>client.navigate(client.url)));}});
Hey, it’s been a while, but what I mention at the end is that maybe this can still resurrect the very same sw which is reloading all clients, even if probably unlikely
Repro steps:
This of course makes it hard to properly unregister a service worker unless u reload all the clients.
This is what I'm doing, but I wonder if this bug can still happen if a client reload with a bit of delay, leading to the old service worker resurrection.
The text was updated successfully, but these errors were encountered: