Intent to Implement and Ship: Add frozen or active lifecycleState to ServiceWorker Client

73 views
Skip to first unread message

Dave Tapuska

unread,
Sep 9, 2019, 3:14:27 PM9/9/19
to blink-dev
dtap...@chromium.org https://github.com/dtapuska/iframe-freeze/blob/master/SW.md Specification: https://wicg.github.io/page-lifecycle/#service-worker-client-lifecycle-state https://github.com/w3c/ServiceWorker/pull/1442 Minor addition of a field Expose the client's PageLifecycle state on the ServiceWorker Client API. Service workers do not know if the state of a client. If a client is frozen it will not immediately handle a postMessage being sent to it. Under some situations the service worker may not wish to spam the client with postMessages because that may cause the client to be discarded. In other situations the service worker may wish to focus the window client causing the client to become unfrozen.
Returning state information in a multiprocess environment always has race and staleness issues and this API can suffer from those. Firefox: Mixed public signals (https://github.com/w3c/ServiceWorker/pull/1442#issuecomment-511536136) Edge: No public signals Safari: Public skepticism (https://github.com/w3c/ServiceWorker/pull/1442#issuecomment-511573439) Skepticism around whole Page Lifecycle API in general. Web developers: No signals
Yes Yes https://wpt.fyi/results/service-workers/service-worker/clients-matchall-frozen.https.html https://crbug.com/1002185 https://www.chromestatus.com/feature/5737408349863936


Philip Jägenstedt

unread,
Sep 10, 2019, 8:09:26 AM9/10/19
to Dave Tapuska, blink-dev
Is there anything we can do to address the concerns in https://github.com/w3c/ServiceWorker/pull/1442?

If not, if the proposal to leave the PR open and ship this anyway, or should we maintain a fork?

--
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 blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAHgVhZU6gQ5PcEkPC8DroMbGkiDG4o35FPN2C3qsBFF63DGQfw%40mail.gmail.com.

Dave Tapuska

unread,
Sep 10, 2019, 8:58:24 AM9/10/19
to Philip Jägenstedt, blink-dev
The page lifecycle spec contains the changes we wish to make to the standards (html & service worker patches). Since this spec introduces the concept of frozeness it seems relevant to place it there until another browser vendor adopts the spec and we can move it into the other standards.

I believe it is still useful to continue the PR being open especially because of this monkey patching via page lifecycle spec.

dave.

Matt Falkenhagen

unread,
Sep 10, 2019, 10:27:37 AM9/10/19
to Dave Tapuska, Philip Jägenstedt, blink-dev
This is one of the topics scheduled for discussion at TPAC in the Service Worker WG meeting next week (https://github.com/w3c/ServiceWorker/issues/1460). It'd probably be good to have the meeting before making a decision on shipping.

Yoav Weiss

unread,
Sep 26, 2019, 2:35:52 PM9/26/19
to Matt Falkenhagen, Dave Tapuska, Philip Jägenstedt, blink-dev

Dave Tapuska

unread,
Sep 27, 2019, 11:12:35 AM9/27/19
to Yoav Weiss, Matt Falkenhagen, Philip Jägenstedt, blink-dev
It was clearer that we won't block additional freezing on this API for service workers. (Specifically desktop freezing and iframe freezing feature policy) While this API is nice to have and would solve problems we currently have those problems in the code with frozen tabs (on Android) anyways so being that there was indecision on the API at TPAC we are going to hold onto this proposal for now. That doesn't mean that we won't revisit it but we need to monitor closely the feedback from developers if there is a strong desire for such an API.

dave.
Reply all
Reply to author
Forward
0 new messages