stream/iter: push() replaces non-Error signal abort reasons #64797
Copy link
Copy link
Closed
Labels
streamIssues and PRs related to Node.js streams.Issues and PRs related to Node.js streams.
Description
Version
main
Platform
macOS 26.5.2
Subsystem
stream
What steps will reproduce the bug?
import { push } from 'node:stream/iter';
const controller = new AbortController();
const reason = 'stop';
const { writer } = push({ signal: controller.signal });
controller.abort(reason);
try {
await writer.write('data');
} catch (error) {
console.log('same reason:', error === reason);
console.log('received:', `${error.name}: ${error.message}`);
}How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
it fails with 'stop', as required by Iterable Streams §7.1, Stream.push(), step 12, which says to put the writer into the failed state with the signal’s abort reason.
What do you see instead?
same reason: false
received: AbortError: AbortedThe writer fails with a newly created AbortError, discarding the string abort reason.
Additional information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
streamIssues and PRs related to Node.js streams.Issues and PRs related to Node.js streams.
Activity
stream: preserve push signal abort reason
stream: preserve push signal abort reason
stream: preserve push signal abort reason
stream: preserve push signal abort reason