Title: stream: fix _final and 'prefinish' timing by ronag · Pull Request #32780 · nodejs/node · GitHub
Open Graph Title: stream: fix _final and 'prefinish' timing by ronag · Pull Request #32780 · nodejs/node
X Title: stream: fix _final and 'prefinish' timing by ronag · Pull Request #32780 · nodejs/node
Description: This PR fixes a few different things: The timing of 'prefinish' depends on whether or not _final is defined. In one case the event is emitted synchronously with end() and otherwise asynchronously. _final is currently unecessarily called asynchronously which forces implementors to use 'prefinish' as a hack to emulate synchronous behaviour. Furthermore, this hack is subtly broken due to the above issue. The stream should not finish if errored or destroyed synchronously during the prefinish stage. Refs: #31401 Refs: #32763 (comment) Checklist make -j4 test (UNIX), or vcbuild test (Windows) passes tests and/or benchmarks are included documentation is changed or added commit message follows commit guidelines
Open Graph Description: This PR fixes a few different things: The timing of 'prefinish' depends on whether or not _final is defined. In one case the event is emitted synchronously with end() and otherwise asynchro...
X Description: This PR fixes a few different things: The timing of 'prefinish' depends on whether or not _final is defined. In one case the event is emitted synchronously with end() and otherwise ...
Opengraph URL: https://github.com/nodejs/node/pull/32780
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/commits/:range(.:format) |
| route-controller | pull_requests |
| route-action | commits |
| fetch-nonce | v2:fd46e15d-98a0-fbd0-f10b-d3b4f0be6930 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CD2E:3A82ED:A8DB91:E9A82C:69975FC7 |
| html-safe-nonce | 58f39e1c8a21b73e31b73705b70919c11ae16ae89c8ac62933eca386acebb472 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDJFOjNBODJFRDpBOERCOTE6RTlBODJDOjY5OTc1RkM3IiwidmlzaXRvcl9pZCI6IjcxMjIzNjkxMTUxMTQxMzU0OTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d75c832e25f748cab505c51b8bd6fbbd05560acf3c74842fb9cf17a3afda511b |
| hovercard-subject-tag | pull_request:402176579 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/nodejs/node/pull/32780/commits/571eb8893763991da627834bf7260f702ab60edf |
| twitter:image | https://avatars.githubusercontent.com/u/3065230?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/3065230?s=400&v=4 |
| og:image:alt | This PR fixes a few different things: The timing of 'prefinish' depends on whether or not _final is defined. In one case the event is emitted synchronously with end() and otherwise asynchro... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | c2f6b9675e9141deef3eda21e5cb896d461bd4d25aeaeeba804502ef0e8d01f2 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 | b05d982477497a3bcc7dafa43a01757894c08f44 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width