Closed as not planned
oven-sh/bun
#34593Closed as not planned
Copy link
Labels
staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.web streamsIssues and PRs related to the Web Streams API.Issues and PRs related to the Web Streams API.
Description
Version
v22.12.0
Platform
No response
Subsystem
No response
What steps will reproduce the bug?
import { Writable } from "node:stream";
const nodeWriteable = new Writable({
write(chunk, encoding, callback) {
// pending
},
highWaterMark: 5,
objectMode: false,
});
const webWritable = Writable.toWeb(nodeWriteable);
const writer = webWritable.getWriter();
writer.write(new Uint8Array(3));
console.log(nodeWriteable.writableLength, writer.desiredSize); // expect 3,2 actual 0,4
let promise = writer.write(new Uint8Array(3));
console.log(nodeWriteable.writableLength, writer.desiredSize); // expect 6, -1, actual 0,3How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
I think writer.desiredSize should be equal to highWaterMark - odeWriteable.writableLength
Otherwise, after the Writable.toWeb() conversion, the buffer queue for the writable stream is expanded
What do you see instead?
none
Additional information
No response
Reacted by 0hm☘️
Metadata
Metadata
Assignees
Labels
staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.web streamsIssues and PRs related to the Web Streams API.Issues and PRs related to the Web Streams API.
Activity
[-]The desiredSize of `Writable. toWeb()` is incorrect[/-][+]The desiredSize of `Writable.toWeb()` is incorrect[/+]bjohansebas commentedon May 24, 2025
cc: @nodejs/whatwg-stream @nodejs/streams
github-actions commentedon Apr 26, 2026
This issue has been marked as stale due to 210 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.
stream: fix Writable.toWeb() desiredSize for non-object-mode
github-actions commentedon May 26, 2026
This issue has been automatically closed after 30 days of inactivity following its stale status (no activity for a total of 240 days).
If this is still relevant, feel free to reopen it or leave a comment with additional details so we can continue the discussion.
stream: fix Writable.toWeb() desiredSize for non-object-mode
stream: fix Writable.toWeb() desiredSize for non-object-mode
stream: fix Writable.toWeb() desiredSize for non-object-mode
stream: fix Writable.toWeb() desiredSize for non-object-mode
stream: fix Writable.toWeb() desiredSize for non-object-mode
stream: fix Writable.toWeb() desiredSize for non-object-mode