Version
26.1.0
Platform
Subsystem
stream
What steps will reproduce the bug?
import { push, text, toWritable } from 'node:stream/iter';
const { writer, readable } = push({ highWaterMark: 1, backpressure: 'block' });
const writable = toWritable(writer);
await new Promise((resolve, reject) => {
writable.write('a', (err) => err ? reject(err) : resolve());
});
writable.write('b');
writable.end();
console.log(await text(readable)); // abb, expected ab
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
The adapter should not write the same chunk twice; the repro should output ab.
What do you see instead?
toWritable() retries via writer.write() when PushWriter.writeSync() returns false, even though PushWriter already accepted the chunk under backpressure: 'block', producing abb.
Additional information
No response
Version
26.1.0
Platform
Subsystem
stream
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
abThe adapter should not write the same chunk twice; the repro should output
ab.What do you see instead?
abbtoWritable()retries viawriter.write()whenPushWriter.writeSync()returns false, even thoughPushWriteralready accepted the chunk underbackpressure: 'block', producingabb.Additional information
No response