| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Clean up end simplify errored state. - errorEmitted should be set in the same tick as 'error' is emitted. - errored should be set as soon as an error occurs. - errored should exist on Readable as well. - refactor destroy logic and make it easier to follow.
|
since this slightly changes timing it should probably be semver-major, even if it only applies to "internal" state. |
Sorry, something went wrong.
|
@nodejs/streams |
Sorry, something went wrong.
There was a problem hiding this comment.
Should we change the docs on any of this at all?
LGTM
Sorry, something went wrong.
I don't think so. Did you have anything specific in mind? This mostly affects internal details and is how I think it is expected to work. |
Sorry, something went wrong.
|
No, not really. |
Sorry, something went wrong.
|
CI: https://ci.nodejs.org/job/node-test-pull-request/27688/ |
Sorry, something went wrong.
|
This need another TSC approval. Maybe @addaleax? |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Clean up end simplify errored state. - errorEmitted should be set in the same tick as 'error' is emitted. - errored should be set as soon as an error occurs. - errored should exist on Readable as well. - refactor destroy logic and make it easier to follow. PR-URL: #30851 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
| Back | FazBrowse Home | New Git URL |
Fix, clean up and simplify errored state.
errorEmitted is currently set in a tick before 'error' is actually emitted which is a bit confusing (and inconsistent with other event has been emitted state, e.g. endEmitted). If we need to know the synchronous error state we should use errored.
There was a potential race in console (at least in theory). We want to swallow an error if it's about to be emitted. However, since errorEmitted was set to true in the tick before the error is actually emitted, the "swallow error" logic might not be applied if the timing is unfortunate.
Checklist