App is not always updated due to Service Worker
The application is stuck in the waiting
phase, and skipWaiting
is never called unless all tabs are closed. Possible solutions:
-
Completely kill the Service Worker. For those of us with the SW installed you will have to explicitly
unregister()
it. -
Keep the SW and add some kind of "Update" button like Notion and other SW-ready apps do. Kind of a hassle honestly :/ And see (3) for some caveats.
IIRC there's a
SKIP_WAITING
handling code in the default CRA SW. -
Automatically call
skipWaiting
on any update (can this be done from the SW itself?) which forces all tabs to refresh.Careful with this! If the user is using the application and an update comes, ongoing work can be lost. I'm not sure if updates are checked periodically, or I did that on purpose on another project but... it happened. Even if it doesn't update automatically, refreshing in a tab will refresh ALL tabs! So work might still be lost.