Title: stream/iter: fromWritable().writev() leaves Writable corked when chunk validation throws · Issue #63294 · nodejs/node · GitHub
Open Graph Title: stream/iter: fromWritable().writev() leaves Writable corked when chunk validation throws · Issue #63294 · nodejs/node
X Title: stream/iter: fromWritable().writev() leaves Writable corked when chunk validation throws · Issue #63294 · nodejs/node
Description: Version 26.1.0 Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { strictEqual, throws } from "node:assert"; import { Writable } from "node:stream"; import { fromWritable } from "node:stream/iter"; const wr...
Open Graph Description: Version 26.1.0 Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { strictEqual, throws } from "node:assert"; import { Writable } from "node:stream"; import { fromWrit...
X Description: Version 26.1.0 Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { strictEqual, throws } from "node:assert"; import { Writable } from "node:stream"...
Opengraph URL: https://github.com/nodejs/node/issues/63294
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"stream/iter: fromWritable().writev() leaves Writable corked when chunk validation throws","articleBody":"### Version\n\n26.1.0\n\n### Platform\n\n```text\nmacOS 26.5.0\n```\n\n### Subsystem\n\nstream\n\n### What steps will reproduce the bug?\n\n```js\nimport { strictEqual, throws } from \"node:assert\";\nimport { Writable } from \"node:stream\";\nimport { fromWritable } from \"node:stream/iter\";\n\nconst writable = new Writable({\n write(chunk, enc, cb) {\n cb();\n },\n});\n\nconst writer = fromWritable(writable);\n\nthrows(() =\u003e writer.writev([new Uint8Array([1]), 42]), {\n code: \"ERR_INVALID_ARG_TYPE\",\n});\n\n// Expected: writev() should uncork even when a later chunk conversion throws.\nstrictEqual(writable.writableCorked, 0);\n```\n\nRun with\n```console\nnode --experimental-stream-iter repro.js\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\n`fromWritable().writev()` should either complete the batched write or throw/reject without changing the underlying `Writable`’s corking state. If `writev()` internally calls `writable.cork()`, it should always pair that with `writable.uncork()`, including when converting or validating a later chunk throws.\n\n### What do you see instead?\n\nCalling `writer.writev([new Uint8Array([1]), 42])` throws `ERR_INVALID_ARG_TYPE`, but the wrapped classic `Writable` remains corked afterward (`writable.writableCorked === 1`). This happens because `writev()` corks before converting all chunks, and if `toUint8Array()` throws for a later chunk, the `uncork()` call is skipped.\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/trivikr","@type":"Person","name":"trivikr"},"datePublished":"2026-05-13T23:16:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/63294/node/issues/63294"}
| 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:2084cd82-04ff-9d07-1506-2fed76aa3d3b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D9DC:1485C9:D9771D:12BC47F:6A4DD315 |
| html-safe-nonce | a3f6e7668a16fbbfbf0a910b006a9af6c8ca82d2e1894a2c903d986a4d64815c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOURDOjE0ODVDOTpEOTc3MUQ6MTJCQzQ3Rjo2QTRERDMxNSIsInZpc2l0b3JfaWQiOiIxNzI3MTU5MTgyNDkyODQzNzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c8fa0d251e5af3746cb8b7b94f0e57f5a0b3536413622da2fcba7d2a4732787c |
| hovercard-subject-tag | issue:4441803077 |
| 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/63294/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b7105c159db701c196ab843e6cd1c9b8af99e838487e50a40d502b070e16863a/nodejs/node/issues/63294 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b7105c159db701c196ab843e6cd1c9b8af99e838487e50a40d502b070e16863a/nodejs/node/issues/63294 |
| og:image:alt | Version 26.1.0 Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { strictEqual, throws } from "node:assert"; import { Writable } from "node:stream"; import { fromWrit... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | trivikr |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| 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 | 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width