Title: stream/iter: push writer.end() resolves before readable drains buffered data · Issue #63502 · nodejs/node · GitHub
Open Graph Title: stream/iter: push writer.end() resolves before readable drains buffered data · Issue #63502 · nodejs/node
X Title: stream/iter: push writer.end() resolves before readable drains buffered data · Issue #63502 · nodejs/node
Description: Version 26.2.0 Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { push } from 'node:stream/iter'; const { writer, readable } = push(); writer.writeSync('hello'); const events = []; writer.end().then(() => ...
Open Graph Description: Version 26.2.0 Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { push } from 'node:stream/iter'; const { writer, readable } = push(); writer.writeSync('hello'); con...
X Description: Version 26.2.0 Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { push } from 'node:stream/iter'; const { writer, readable } = push(); writer.writeSync('...
Opengraph URL: https://github.com/nodejs/node/issues/63502
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"stream/iter: push writer.end() resolves before readable drains buffered data","articleBody":"### Version\n\n26.2.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 { push } from 'node:stream/iter';\n\nconst { writer, readable } = push();\nwriter.writeSync('hello');\nconst events = [];\n\nwriter.end().then(() =\u003e {\n events.push('end resolved');\n});\n\nawait Promise.resolve();\n\nevents.push('after microtask');\nfor await (const _ of readable) {\n events.push('readable drained');\n}\nconsole.log(events);\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```console\n[ 'after microtask', 'readable drained', 'end resolved' ]\n```\n\n`writer.end()` should stay pending until the readable drains, so end resolved should appear after readable drained.\n\n### What do you see instead?\n\n```console\n[ 'end resolved', 'after microtask', 'readable drained' ]\n```\n\n`writer.end()` currently resolves before the readable side consumes the buffered `\"hello\"` chunk\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/trivikr","@type":"Person","name":"trivikr"},"datePublished":"2026-05-23T05:58:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/63502/node/issues/63502"}
| 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:1172d614-45c0-39f4-f76f-7f456be271b6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8F88:270D1E:3960DA:4D3B34:6A4D2F35 |
| html-safe-nonce | bddb90774217ff179c660a68f87fd24178ff759255c5ba4d0b3fc18213b235aa |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Rjg4OjI3MEQxRTozOTYwREE6NEQzQjM0OjZBNEQyRjM1IiwidmlzaXRvcl9pZCI6IjQ2NjEzOTczMzMxOTkzNjc5ODkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 51cb455d547b1c4cf99d822be8b930b8abf213cbbd5cfdc98dddef40633c5e9f |
| hovercard-subject-tag | issue:4507054324 |
| 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/63502/issue_layout |
| twitter:image | https://opengraph.githubassets.com/24f7f007d0c4a3f8d7d0edb3754451d0db32df824018faee6b1c99d6f72ea8cb/nodejs/node/issues/63502 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/24f7f007d0c4a3f8d7d0edb3754451d0db32df824018faee6b1c99d6f72ea8cb/nodejs/node/issues/63502 |
| og:image:alt | Version 26.2.0 Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { push } from 'node:stream/iter'; const { writer, readable } = push(); writer.writeSync('hello'); con... |
| 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 | 92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6 |
| 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 | 93f17a978ee60bc4668e1d7b90e6bd2d622261fd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width