Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Request constructor duplex option #31735

Open
dcecile opened this issue Jan 16, 2024 · 2 comments
Open

Missing Request constructor duplex option #31735

dcecile opened this issue Jan 16, 2024 · 2 comments
Labels
area: Fetch/XMLHttpRequest Content:WebAPI Web API docs goal: completeness (Experiment label) Issues about content missing important/relevant details.

Comments

@dcecile
Copy link
Contributor

dcecile commented Jan 16, 2024

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/Request/Request

What specific section or headline is this issue about?

Parameters

What information was incorrect, unhelpful, or incomplete?

The spec has a duplex option, but it's missing from the page

What did you expect to see?

A note about the parameter, and that it needs to be set to "half" when using a ReadableStream body.

It would also be nice to have a row for browser compatibility.

Do you have any supporting links, references, or citations?

Spec: https://fetch.spec.whatwg.org/#request-class
Chrome docs (showing how to do half-duplex fetch): https://developer.chrome.com/docs/capabilities/web-apis/fetch-streaming-requests
Related web platform test: https://wpt.fyi/results/fetch/api/request/request-init-stream.any.html?label=master&label=experimental&aligned&q=request-init-stream

Do you have anything more you want to share?

The Request class itself also has a duplex get-only property, so main page (https://developer.mozilla.org/en-US/docs/Web/API/Request) is affected and an instance property page is missing too

MDN metadata

Page report details
@dcecile dcecile added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Jan 16, 2024
@github-actions github-actions bot added the Content:WebAPI Web API docs label Jan 16, 2024
@Josh-Cena Josh-Cena added area: Fetch/XMLHttpRequest goal: completeness (Experiment label) Issues about content missing important/relevant details. and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Jan 16, 2024
@Josh-Cena
Copy link
Member

None of the browsers implement it yet. Check the browser bugs linked in whatwg/fetch#1493.

@Josh-Cena Josh-Cena added the waiting for implementations Waiting for feature to be implemented in browsers label Jan 16, 2024
@dcecile
Copy link
Contributor Author

dcecile commented Feb 4, 2024

Based on this test, I think Blink has the duplex constructor option implemented?

test((t) => {
  const body = new ReadableStream();
  assert_throws_js(TypeError,
                   () => new Request("...", { method, body }));
}, "It is error to omit .duplex when the body is a ReadableStream.");

https://github.com/web-platform-tests/wpt/blob/faa6d42ce21d126155dee771786ad7c74efbcba5/fetch/api/request/request-init-stream.any.js#L79-L83

image

https://wpt.fyi/results/fetch/api/request/request-init-stream.any.html?label=master&label=experimental&aligned&q=request-init-stream

@Josh-Cena Josh-Cena removed the waiting for implementations Waiting for feature to be implemented in browsers label Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Fetch/XMLHttpRequest Content:WebAPI Web API docs goal: completeness (Experiment label) Issues about content missing important/relevant details.
2 participants