Re: [whatwg/streams] Possible spec bug with concurrent byob reads (#1170)

There's another bug in here that I've found, also relating to the byobRequest getter and autoAllocateChunkSize is used.

```js
const rs = new ReadableStream({
  type: 'bytes',
  autoAllocateChunkSize: 10,
  pull(c) {
    c.enqueue(new Uint8Array(10));
    c.byobRequest.respond(10);
  }
});

const reader = rs.getReader();

console.log(await reader.read());

console.log('test');

```

This code currently causes the chrome browser tab to crash and Node.js' implementation to assert. The reason is because, while the `enqueue()` does invalidate the current `byobRequest`, the pending pull into is not cleared, meaning that the byobRequest is just recreated when the getter is invoked again.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/1170#issuecomment-933724351

Received on Monday, 4 October 2021 18:04:25 UTC