Version
26.2.0
Platform
Subsystem
stream
What steps will reproduce the bug?
import { broadcast } from 'node:stream/iter';
const { writer, broadcast: bc } = broadcast();
const it = bc.push()[Symbol.asyncIterator]();
const first = it.next();
const second = it.next();
await writer.write('x');
console.log('second next():', await second);
const result = await Promise.race([
first.then((value) => ['settled', value]),
new Promise((resolve) => setTimeout(resolve, 50, ['pending'])),
]);
console.log('first next():', ...result);
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
second next(): { done: true, value: undefined }
first next(): settled { done: false, value: [ Uint8Array(1) [ 120 ] ] }
What do you see instead?
second next(): { done: false, value: [ Uint8Array(1) [ 120 ] ] }
first next(): pending
Additional information
No response
Version
26.2.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?
What do you see instead?
Additional information
No response