write a WPT verifying workers get their own client ID

RESOLVED FIXED in Firefox 61

Status

()

enhancement
P2
normal
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: bkelly, Assigned: bkelly)

Tracking

(Blocks 2 bugs)

unspecified
mozilla61
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox61 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

I have an interop report from a site related to worker client ID values.  The site is expecting the chrome's behavior where FetchEvent.clientId values coming from a dedicated worker match the owning document's clientId.  This is not correct given the current spec.

In addition, it seems edge has matched chrome's non-spec behavior here.

We should get a WPT establishing the correct spec behavior ASAP to prevent further interop issues in the future.
Priority: -- → P2
Andrew, this is a WPT test that verifies a dedicated worker has its own client ID and does not share its parent window's client ID.  The spec requires the FetchEvent.clientId to be the id for the "request's client":

https://fetch.spec.whatwg.org/#concept-request-client

I can't find where "request's client" is explicitly set, but things like step 1 here clearly expect it to hold worker clients, etc:

https://fetch.spec.whatwg.org/#fetching

https://treeherder.mozilla.org/#/jobs?repo=try&revision=54cb31d450e1b2d4978aa4ae6b5ff2db1281bd4a
Attachment #8964697 - Flags: review?(bugmail)
Comment on attachment 8964697 [details] [diff] [review]
Add a WPT test to verify dedicated workers have a separate client ID from their owning document. r=asuth

Review of attachment 8964697 [details] [diff] [review]:
-----------------------------------------------------------------

::: testing/web-platform/tests/service-workers/service-worker/worker-client-id.https.html
@@ +34,5 @@
> +
> +promise_test(async function(t) {
> +  const script = './resources/worker-client-id-worker.js';
> +  const scope = './resources/worker-client-id';
> +  const frame = scope + '/frame.html';

Per IRC discussion (thanks for clarifying!), please either explicitly add a comment that this is expected to 404 or respondWith an empty doc like you alternately proposed.  Thanks!
Attachment #8964697 - Flags: review?(bugmail) → review+

Comment 4

a year ago
Pushed by bkelly@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/aed7d4d9be32
Add a WPT test to verify dedicated workers have a separate client ID from their owning document. r=asuth

Comment 5

a year ago
Yep, Chrome and Edge are wrong here. Thanks for creating a test.

Comment 6

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/aed7d4d9be32
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61

Comment 7

a year ago
Safari also gets this wrong. Demo: https://worker-client-id-demo.glitch.me/
James, is the wpt sync bot operational at the moment?  I was hoping to get this synced to the other browsers.
Flags: needinfo?(james)
It's hit a case it doesn't handle, which blocks subsequent upstreams. I'm already on it, hopefully it will be unblocked today.
Flags: needinfo?(james)
Created web-platform-tests PR https://github.com/w3c/web-platform-tests/pull/10418 for changes under testing/web-platform/tests
You need to log in before you can comment on or make changes to this bug.