*Contact email:* [email protected]

*Explainer*: N/A (spec compliance fix)

*Specification*: 
https://w3c.github.io/ServiceWorker/#fire-functional-event-algorithm (step 
8)

*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).

Chrome currently does not implement this. It updates only trigger via page 
navigations or a staleness timer that requires the worker to run for > 30s, 
which rarely happens for short-lived push event handlers.

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.

*Blink component:* Blink>ServiceWorker

*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.

*Tracking bug*: https://crbug.com/486495094

*Risks*: Low — ScheduleUpdate() is idempotent, and when the script is 
unchanged, the conditional HTTP request returns 304 with no installation 
overhead. The behavioral change is that stale registrations will now check 
for updates after background events, which is the spec-intended behavior.

*Chrome status:* TBD, I've requested access to add the feature 
on https://chromestatus.com/features, I'll update this thread when I've 
gained access and posted the appropriate update.

Thanks everyone,

Xavier

-- 
You received this message because you are subscribed to the Google Groups 
"blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/4b716865-8b88-4734-9d34-ea5f93b7b8b5n%40chromium.org.

Reply via email to