Intent to Implement and Ship: FetchEvent.resultingClientId

57 views
Skip to first unread message

Matt Falkenhagen

unread,
Oct 1, 2018, 3:51:14 AM10/1/18
to blink-dev

Contact emails

fal...@chromium.org


Explainer

This is in the Service Worker specification. There is some background at https://github.com/w3c/ServiceWorker/issues/1091 and https://github.com/w3c/ServiceWorker/issues/1245.


Design doc/Spec

https://w3c.github.io/ServiceWorker/#fetch-event-resultingclientid


Tag review requested.


Summary

FetchEvent.resultingClientId is set for main resource requests (requests for documents or workers). It is the id of the Client potentially created by the request.


Motivation

Without resultingClientId, it is difficult to associate the FetchEvent for the main resource request for a document with subsequent FetchEvents for subresource requests from the document. Such association can be useful for logging and metrics purposes, e.g., measuring milestones in page load time.


It is also needed to make a polyfill for AppCache using service worker. It would enable associating a page to a given cache for its lifespan.


Risks

Interoperability and Compatibility

It is a new addition to an existing feature. There is low risk as it has been discussed in various meetings and GitHub issues for some time, which resulted in its incorporation into the specification.


Edge: No signals

Firefox: Public support

Safari: No signals

Web developers: It is a minor addition to an existing feature so it hasn’t had much publicity. I’ve heard feedback that it would be useful from internal developers and from the AppCache discussion.


Ergonomics

Are there any other platform APIs this feature will frequently be used in tandem with? No

Could the default usage of this API make it hard for Chrome to maintain good performance (i.e. synchronous return, must run on a certain thread, guaranteed return timing)? No


Activation

Will it be challenging for developers to take advantage of this feature immediately, as-is? No

Would this feature benefit from having polyfills, significant documentation and outreach, and/or libraries built on top of it to make it easier to use? No


Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes


Is this feature fully tested by web-platform-tests?

Yes. https://github.com/web-platform-tests/wpt/blob/master/service-workers/service-worker/navigation-redirect.https.html


Link to entry on the feature dashboard

https://www.chromestatus.com/feature/4846038800138240


Requesting approval to ship?

Yes


Philip Jägenstedt

unread,
Oct 1, 2018, 5:53:51 AM10/1/18
to Matt Falkenhagen, blink-dev
LGTM1

This looks like a small iterative change. I think it would have been OK to skip the TAG review, but it was filed so recently that I don't think we can expect a reaction before this change is landed. That just means that we should still be ready for design-altering feedback as long as this hasn't reached stable and is constrained by web compat, which is a good many weeks away still.

It looks like https://w3c.github.io/ServiceWorker/#on-fetch-request-algorithm is the algorithm where the event is dispatched with resultingClientId set to a non-empty string, and the relevant tests are in around check_resulting_client_ids. Looks good to me!

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJ_xCikLcVH1_miS_0P2eWppVOXh%3DyjXhwuGh_Cwsd6BXr4vKw%40mail.gmail.com.

Daniel Bratell

unread,
Oct 1, 2018, 7:43:42 AM10/1/18
to Matt Falkenhagen, Philip Jägenstedt, blink-dev
LGTM2

/Daniel
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/CAARdPYfvu19S_2txf3KPSXnx4hPQMCtARd1Eoo2iOvE1yFJotQ%40mail.gmail.com.



--
/* Opera Software, Linköping, Sweden: CEST (UTC+2) */

Mike West

unread,
Oct 1, 2018, 9:27:46 AM10/1/18
to Daniel Bratell, Matt Falkenhagen, Philip Jägenstedt, blink-dev

Joe Medley

unread,
Oct 1, 2018, 11:02:51 AM10/1/18
to Mike West, bra...@opera.com, Matt Falkenhagen, Philip Jägenstedt, blink-dev
Matt,

Do you have a tracking bug for this?
Joe Medley | Technical Writer, Chrome DevRel | jme...@google.com | 816-678-7195
If an API's not documented it doesn't exist.


Matt Falkenhagen

unread,
Oct 1, 2018, 11:46:31 PM10/1/18
to Joe Medley, Mike West, Daniel Bratell, Philip Jägenstedt, blink-dev
On Tue, Oct 2, 2018 at 12:02 AM Joe Medley <jme...@google.com> wrote:
Matt,

Do you have a tracking bug for this?


Sorry, I pasted the wrong bug link to chromestatus. It's https://bugs.chromium.org/p/chromium/issues/detail?id=778497

Daniel Vogelheim

unread,
Oct 15, 2018, 6:43:29 AM10/15/18
to Matt Falkenhagen, blink-dev
On Mon, Oct 1, 2018 at 9:51 AM Matt Falkenhagen <fal...@chromium.org> wrote:
Matt, please start a privacy review for this feature. Thanks.
Reply all
Reply to author
Forward
0 new messages