Skip to content

stream: align Readable.toWeb termination with eos - #62394

Merged
aduh95 merged 12 commits into
nodejs:mainfrom
ikeyan:fix-stream-readable-to-web
May 19, 2026
Merged

aduh95 merged 12 commits into
nodejs:mainfrom
ikeyan:fix-stream-readable-to-web

Conversation

@ikeyan

@ikeyan ikeyan commented Mar 22, 2026 •

Copy link
Copy Markdown
Contributor

This aligns Readable.toWeb(stream) termination handling with
eos(stream, { writable: false }).

Changes:

  • add regression tests for half-open duplex termination
  • add regression coverage for adapter creation before and after
    end(), destroy(), and destroy(error)
  • preserve terminated Readable adapter state, including closed/error
    state and byte stream type, regardless of when the adapter is created
  • let Readable.toWeb() reuse eos() immediate completion handling
    for already-terminated streams
  • add regression coverage for the synchronous internal EOS callback
    path, including listener cleanup and BYOB termination

Tests:

  • make lint
  • ./configure && make -j4 test

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/streams

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. stream Issues and PRs related to Node.js streams. web streams Issues and PRs related to the Web Streams API. labels Mar 22, 2026
@codecov