Re: [whatwg/streams] Readable byte stream must call pull after receiving new chunk (#877)

Hmm, looks like this might be slightly trickier than I initially thought. With my proposed fix, two tests fail:
```
  × ReadableStream with byte source: autoAllocateChunkSize
  
    assert_equals: pull() should only be invoked once expected 1 but got 2
        at Promise.resolve.then.then.result (http://127.0.0.1:60503/streams/readable-byte-streams/general.js:349:5)

  × ReadableStream with byte source: Respond to pull() by enqueue() asynchronously
  
    assert_equals: pullCount after completion of all read()s expected 1 but got 2
        at Promise.all.then.result (http://127.0.0.1:60503/streams/readable-byte-streams/general.js:710:5)
```
The first test seems wrong to me. There are two `read()` calls, `pull()` calls `respond()` once, so I'd expect two `pull()`s are needed to fulfill both reads. However, the assert seems to expect only one pull? Why is that?

The second test seems like a bug with my fix. Here, `pull()` calls `close()`, so there's no point in calling `pull()` a second time. It looks like I need to tweak this a bit...

-- 
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/877#issuecomment-363941374

Received on Wednesday, 7 February 2018 23:07:53 UTC