{{ message }}
Repository navigation
Commit 5661526
stream: fix ERR_INVALID_STATE when cancelling Readable.toWeb()
When a web ReadableStream returned by Readable.toWeb() is cancelled
while the underlying Readable is actively producing data, a pending
onData callback can still fire after the controller has been closed
and attempt to enqueue a chunk, throwing ERR_INVALID_STATE.
Check wasCanceled in the onData handler and return early to avoid
calling controller.enqueue() on a closed controller.
Refs: #54205
Signed-off-by: Richard Scarrott <riscarrott@googlemail.com>
PR-URL: #62773
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent 4141e22 commit 5661526
2 files changed
Lines changed: 23 additions & 0 deletions

0 commit comments