Title: stream/iter: fromWritable() cache ignores later options · Issue #63277 · nodejs/node · GitHub
Open Graph Title: stream/iter: fromWritable() cache ignores later options · Issue #63277 · nodejs/node
X Title: stream/iter: fromWritable() cache ignores later options · Issue #63277 · nodejs/node
Description: Version 26.1.0 Platform macOS 26.4.1 Subsystem stream What steps will reproduce the bug? import { throws } from "assert"; import { Writable } from "stream"; import { fromWritable } from "stream/iter"; const writable = new Writable({ high...
Open Graph Description: Version 26.1.0 Platform macOS 26.4.1 Subsystem stream What steps will reproduce the bug? import { throws } from "assert"; import { Writable } from "stream"; import { fromWritable } from "stream/ite...
X Description: Version 26.1.0 Platform macOS 26.4.1 Subsystem stream What steps will reproduce the bug? import { throws } from "assert"; import { Writable } from "stream"; import { fromWritabl...
Opengraph URL: https://github.com/nodejs/node/issues/63277
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"stream/iter: fromWritable() cache ignores later options","articleBody":"### Version\n\n26.1.0\n\n### Platform\n\n```text\nmacOS 26.4.1\n```\n\n### Subsystem\n\nstream\n\n### What steps will reproduce the bug?\n\n```js\nimport { throws } from \"assert\";\nimport { Writable } from \"stream\";\nimport { fromWritable } from \"stream/iter\";\n\nconst writable = new Writable({\n highWaterMark: 1,\n write(chunk, enc, cb) {\n // Keep the internal buffer full.\n },\n});\n\n// First call creates and caches the default strict writer.\nfromWritable(writable);\n\n// Bug 1: invalid options are ignored because the cached writer is returned\n// before options are validated.\nthrows(() =\u003e fromWritable(writable, { backpressure: \"invalid\" }), {\n code: \"ERR_INVALID_ARG_VALUE\",\n});\n\n// Bug 2: later valid options are ignored too. This should create/use a\n// drop-newest writer, but currently returns the cached strict writer.\nconst writer = fromWritable(writable, { backpressure: \"drop-newest\" });\n\nawait writer.write(\"a\");\n\n// Expected: resolves and drops the chunk.\n// Actual: rejects with ERR_INVALID_STATE from strict backpressure.\nawait writer.write(\"b\");\n\nwritable.destroy();\n```\n\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\nNo assertion failure, second write resolves.\n\n### What do you see instead?\n\nThe invalid option does not throw.\n\nIf you remove the throws() block, the second write rejects as strict backpressure.\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/trivikr","@type":"Person","name":"trivikr"},"datePublished":"2026-05-13T07:04:26.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/63277/node/issues/63277"}
| 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:7413448c-a5f6-45a4-a7fe-0dfa5d84439f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8EEE:3007FC:361FF1:4CBC0A:6A4E6A5E |
| html-safe-nonce | a0e68fc4c95baae5e81b2d557b036eefcba051470195a17783f5971659a139fe |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RUVFOjMwMDdGQzozNjFGRjE6NENCQzBBOjZBNEU2QTVFIiwidmlzaXRvcl9pZCI6IjczODA1MDUzMDgyNjk4MDAwMzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f7de182ae47f0822bcae47f59212d732bdffc4afd8db2a455f42127d4d78d0a4 |
| hovercard-subject-tag | issue:4435667436 |
| 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/63277/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d24bc769682b659e32e173b8523aebb6fa99c1e071452fd7829c0eb9bb08e916/nodejs/node/issues/63277 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d24bc769682b659e32e173b8523aebb6fa99c1e071452fd7829c0eb9bb08e916/nodejs/node/issues/63277 |
| og:image:alt | Version 26.1.0 Platform macOS 26.4.1 Subsystem stream What steps will reproduce the bug? import { throws } from "assert"; import { Writable } from "stream"; import { fromWritable } from "stream/ite... |
| 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 | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| 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 | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width