mirror of
https://github.com/suitenumerique/docs.git
synced 2026-09-27 03:55:01 +02:00
During rolling deploys, multiple replicas serve different builds of service-worker.js (each build has a random buildId baked in). This causes a controllerchange loop: the new SW activates via skipWaiting, the page reloads, then the next request may hit an older replica,triggering another update and another reload — surfacing as a reload every time the tab becomes visible. We added a sessionStorage guard so a controllerchange triggers at most one automatic reload per session; subsequent flaps between versions are silently ignored, while legitimate updates still cause a single reload automatically.