Title: The desiredSize of `Writable.toWeb()` is incorrect · Issue #56269 · nodejs/node · GitHub
Open Graph Title: The desiredSize of `Writable.toWeb()` is incorrect · Issue #56269 · nodejs/node
X Title: The desiredSize of `Writable.toWeb()` is incorrect · Issue #56269 · nodejs/node
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...
Open Graph 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, ca...
X 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, en...
Opengraph URL: https://github.com/nodejs/node/issues/56269
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"The desiredSize of `Writable.toWeb()` is incorrect","articleBody":"### Version\n\nv22.12.0\n\n### Platform\n\n_No response_\n\n### Subsystem\n\n_No response_\n\n### What steps will reproduce the bug?\n\n```ts\nimport { Writable } from \"node:stream\";\n\nconst nodeWriteable = new Writable({\n write(chunk, encoding, callback) {\n // pending\n },\n highWaterMark: 5,\n objectMode: false,\n});\nconst webWritable = Writable.toWeb(nodeWriteable);\nconst writer = webWritable.getWriter();\nwriter.write(new Uint8Array(3));\nconsole.log(nodeWriteable.writableLength, writer.desiredSize); // expect 3,2 actual 0,4\n\nlet promise = writer.write(new Uint8Array(3));\n\nconsole.log(nodeWriteable.writableLength, writer.desiredSize); // expect 6, -1, actual 0,3\n\n```\n\n### How often does it reproduce? Is there a required condition?\n\nalways\n\n### What is the expected behavior? Why is that the expected behavior?\n\nI think `writer.desiredSize` should be equal to `highWaterMark - odeWriteable.writableLength`\nOtherwise, after the Writable.toWeb() conversion, the buffer queue for the writable stream is expanded\n\n### What do you see instead?\n\nnone\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/eavidy","@type":"Person","name":"eavidy"},"datePublished":"2024-12-16T07:38:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/56269/node/issues/56269"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d5131fab-ff2e-1299-722a-7f4f771ff7c8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 922C:19F979:12659C9:198DA23:6A4CA9AE |
| html-safe-nonce | ac55e1e1f6cf09757c9d1918de7ae546cf4d8756f4651ed8d01a11e8e571fa9b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MjJDOjE5Rjk3OToxMjY1OUM5OjE5OERBMjM6NkE0Q0E5QUUiLCJ2aXNpdG9yX2lkIjoiNzUyMzIyMzA3MjkwMTIxMjU5MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a332046939688430513cfb992923386a600e5ab2b7d96d66beb8d89c13ae95cd |
| hovercard-subject-tag | issue:2741579827 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/56269/issue_layout |
| twitter:image | https://opengraph.githubassets.com/35de51283cfaff975b8e27e6e3309657113df1cdd89652d3d45c41add5465dde/nodejs/node/issues/56269 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/35de51283cfaff975b8e27e6e3309657113df1cdd89652d3d45c41add5465dde/nodejs/node/issues/56269 |
| og:image:alt | 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, ca... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | eavidy |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ae90d426644ca15e89bacceb72e51f4e9dbf85f7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width