Skip to content

stream: fix recursive WritableStream abort - #64825

Open
standard-Chan wants to merge 1 commit into
nodejs:mainfrom
standard-Chan:fix-writable-stream-recursive-abort
Open

stream: fix recursive WritableStream abort#64825
standard-Chan wants to merge 1 commit into
nodejs:mainfrom
standard-Chan:fix-writable-stream-recursive-abort

Conversation

@standard-Chan

@standard-Chan standard-Chan commented Jul 29, 2026

Copy link
Copy Markdown

Re-check the stream state after signaling the controller's abort signal, as required by steps 3 and 4 of the WritableStreamAbort algorithm.

Refs: https://streams.spec.whatwg.org/#writable-stream-abort

Also, reject close promise caches only when their promises are still pending. A cache lazily materialized after the stream becomes errored may already contain a rejected promise and does not have a callable reject method.

Remove the expected-failure entry for the recursive abort WPT.

Testing

$ ./node test/wpt/test-streams.js writable-streams/aborting.any.js

Files: 1/1 ran, 1 passed, 0 skipped, 0 expected failures, 0 unexpected failures, 0 unexpected passes
Subtests: 65 passed, 0 skipped, 0 expected failures, 0 unexpected failures, 0 unexpected passes

Recheck the stream state after signaling abort, as required by steps 3
and 4 of the WritableStreamAbort algorithm.

Only reject pending close promise caches, as a cache materialized after
the stream becomes errored may already contain a rejected promise.

This makes the recursive abort WPT pass and removes its expected-failure
entry.

Refs: https://streams.spec.whatwg.org/#writable-stream-abort
Signed-off-by: Jeong SeokChan <starp321@naver.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/web-standards

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. web streams labels Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. web streams

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants