Closed Bug 1809673 Opened 2 years ago Closed 2 years ago

BYOB reader.read() never resolves when created from Response

Categories

(Core :: DOM: Streams, defect)

defect

Tracking

()

RESOLVED FIXED
110 Branch
Tracking Status
firefox110 --- fixed

People

(Reporter: saschanaz, Assigned: saschanaz)

References

Details

Attachments

(2 files)

await (async () => {
  const reader = new Response("HELLO").body.getReader({ mode: "byob" });
  let done;
  while (!done) {
    // await new Promise(setTimeout)
    const result = await reader.read(new Uint8Array(2));
    done = result.done;
    console.log(result);
  }
})()

Without setTimeout: 3 chunks "HE", "LL", "O" are read but then it stalls
With setTimeout: 1 chunk "HE" is read and then it ends, losing everything else.

Needs to be investigated.

Assignee: nobody → krosylight

This adds some of the public helper functions for ReadableStream provided by the spec, that are needed for BodyStream.

Depends on D166534

Pushed by krosylight@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7e164e4bbc2f Part 1: Stop using stream internal algorithms from BodyStream r=smaug,evilpie https://hg.mozilla.org/integration/autoland/rev/c03fafca6fb4 Part 2: Add tests for BYOB readers from Response r=smaug
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/37910 for changes under testing/web-platform/tests
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 110 Branch
Regressions: 1810261
Upstream PR merged by sideshowbarker
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: