Service Worker soft update after functional events
- Category
- Service Worker
- Type
- Chromium catches up
- Status
- Proposed (Chrome Proposed)
- Intent stage
- None
Summary
The Service Worker spec requires a "soft update" after each functional event (push, notification click/close, background sync, payment, etc.) completes on a stale registration (last update check > 24h). This change adds a centralized FireFunctionalEvent() method to ServiceWorkerVersion that implements the spec's "Fire Functional Event" algorithm, including soft update triggers at steps 3 (should skip event), 5 (worker start failure), and 8 (after event completion). Each functional event dispatcher is migrated to use this method.
Motivation
Without this, a service worker updated on the server is never detected upon receiving push notifications unless the user navigates to the page. This breaks the 24h update guarantee the spec provides
Standards & signals
- Specification: https://w3c.github.io/ServiceWorker/#fire-functional-event-algorithm
- Firefox: No signal
- Safari: No signal
- Web developers: No signals
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=service-worker-soft-update-after-functional-events
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+Service%20Worker%20soft%20update%20after%20functional%20events
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=Service%20Worker%20soft%20update%20after%20functional%20events
- Baseline status: https://webstatus.dev/?q=Service%20Worker%20soft%20update%20after%20functional%20events