Skip to content

stream/iter: toReadableSync() drops chunks after backpressure #63275

@trivikr

Description

@trivikr

Version

26.1.0

Platform

macOS 26.4.1 (25E253)

Subsystem

stream

What steps will reproduce the bug?

import { toReadableSync } from 'node:stream/iter';

function* gen() {
  yield [
    Buffer.from('a'),
    Buffer.from('b'),
    Buffer.from('c'),
  ];
}

const readable = toReadableSync(gen(), { highWaterMark: 1 });

readable.on('data', (chunk) => {
  console.log(chunk.toString());
});

readable.on('end', () => {
  console.log('end');
});

To run it

node --experimental-stream-iter repro.js

How often does it reproduce? Is there a required condition?

Always.

What is the expected behavior? Why is that the expected behavior?

a
b
c
end

What do you see instead?

a
end

Additional information

No response

Metadata

Metadata

Assignees

Labels

streamIssues and PRs related to the stream subsystem.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions