A progressive web application downloads new code while an older version remains open. Activating immediately may reload the page and discard a draft; delaying forever leaves users on known defects. Service worker update UX is the product decision between those extremes. The application needs to know when a worker is waiting, when the user's state is safe and how multiple open tabs will move to one compatible version.
Imagine a field technician completing a long inspection checklist. An update becomes available halfway through. “Refresh now” is only helpful if the draft survives and the new application can read it.
Understand the waiting state
A newly installed worker normally waits while pages controlled by the current worker remain open. This behavior protects active clients from changing underneath themselves. Detect registration updates and communicate the waiting version to the application. Do not assume that downloading assets means every tab is now using them.
Keep asset versions internally consistent. A new shell combined with old lazy-loaded files can fail if deployment removes earlier assets too quickly. Retain the files needed by active clients for an appropriate window and make network failures understandable.
Choose a safe moment to invite activation
A passive browsing page can show a modest update notice. A form with unsaved changes should defer or save first. The interface should state what will happen: the application needs to reload, saved work will remain, or the update can wait. Avoid repeated banners that interrupt every navigation without giving the user a meaningful choice.
For critical security fixes, the business may choose a firmer deadline. Even then, preserve work where possible and explain the transition. A forced refresh should be a defined operational policy, not the accidental result of calling skipWaiting in every release.
Coordinate activation and reload
When the user accepts, ask the waiting worker to activate through an explicit message. Listen for the controller change and reload once, guarding against loops. If several tabs are open, use a broadcast mechanism or shared state so they do not present contradictory prompts or repeatedly trigger activation.
Persist important drafts in a schema the new version can migrate. Validate stored data before use and keep migrations forward-aware. An update mechanism is incomplete if the code changes safely but local work becomes unreadable.
Test versions as a sequence, not a fresh install
Deploy version A, open two tabs, create an unsaved draft and then make version B available. Observe installation, prompt timing, acceptance, controller change and restoration. Repeat with one tab offline, an update download failure and a user who postpones until the next day. Confirm that caches do not grow without bound.
web.dev documents the service worker lifecycle and update patterns. The practical goal is continuity: the user can finish important work, the application can move to a supported version, and the team can explain which code controls each open client throughout the transition.
For related delivery support, explore 4Minds Technology's web development and UI, UX and product design. A useful implementation should leave the operating rule, evidence and ownership clear enough for the next team member to maintain. Record the final decision beside the system so future changes can be reviewed against the original purpose.



