I'm registering service worker with the following updated callback:
updated() {
alert('An update is ready. Please refresh the page.')
},
I make a minor change to the content of service-worker.js file to the browsers detect the change.
const version = 3.7;
When I deploy it I successfully get the updated alert but when I refresh I get it again. However I receive the new changes but I still get this alert which is not necessary anymore.
This code fixed the problem
self.addEventListener('install', function(event) {
self.skipWaiting();
});