Update Service Workers: Pull current version
Background
When an updated version of the app is pushed to the production domains, the webpage/progressive web app is not automatically reloaded – due to service workers caching everything. This means that the user might still be running an older version. This is critical because not only are new features not being used but the transmission of data might fail - we switched the signaling server between patches - not a good idea.
What is to be done?
The App should be able to detect changes to the server (if online) and tell the user about them; if the user confirms download the new version
This already worked in the past: There is UpdateService
in @rcc/features, that makes use of RccVersionControlService
of @rcc/common/_service-worker. None of the two modules is being used at the moment.
Please check if they still work and solve this issue. Try getting them to work if they don't.
I think there is no need to get into what our service workers are actually doing. RccVersionControlService
looks kind of agnostic towards what the service worker code does.
Since we do workh wit the angular ServiceWorkerModule
– on top of our own custom shenanigans – we could also just make use of angular's SwUpdate
.