stream: use synchronous error validation & validate abort signal option#41777
Merged
nodejs-github-bot merged 1 commit intonodejs:masterfrom Feb 3, 2022
Merged
Conversation
Collaborator
|
Review requested:
|
49b4925 to
347b307
Compare
benjamingr
reviewed
Jan 30, 2022
benjamingr
reviewed
Jan 30, 2022
Member
benjamingr
left a comment
There was a problem hiding this comment.
Left some comment about the difference between errors in generators/async functions in this API other than that looks good thanks 🙏
made sure top level methods aren't async/generators so that validation errors could be caught synchronously also added validation for the abort signal option
347b307 to
2e4f992
Compare
benjamingr
approved these changes
Jan 31, 2022
Collaborator
Collaborator
This was referenced Feb 1, 2022
Linkgoron
reviewed
Feb 3, 2022
Comment on lines
+192
to
+194
| if (options?.signal != null) { | ||
| validateAbortSignal(options.signal, 'options.signal'); | ||
| } |
Contributor
There was a problem hiding this comment.
This can be simplified to validateAbortSignal(options?.signal, 'options.signal') (also in other places)
Linkgoron
reviewed
Feb 3, 2022
Comment on lines
+124
to
+125
| assert.rejects(() => Readable.from([]).reduce((x, y) => x + y, 0, 1), /ERR_INVALID_ARG_TYPE/); | ||
| assert.rejects(() => Readable.from([]).reduce((x, y) => x + y, 0, { signal: true }), /ERR_INVALID_ARG_TYPE/); |
Contributor
There was a problem hiding this comment.
these two should probably have .then(common.mustCall()) (e.g. like you did in test-stream-some-every)
Contributor
There was a problem hiding this comment.
You can also add it to the two lines above them (that you didn't add).
Linkgoron
approved these changes
Feb 3, 2022
Collaborator
|
Landed in 06625ff |
Contributor
Author
|
@Linkgoron would you like me to take care of your notes in a future PR? |
VoltrexKeyva
pushed a commit
to VoltrexKeyva/node
that referenced
this pull request
Feb 3, 2022
made sure top level methods aren't async/generators so that validation errors could be caught synchronously also added validation for the abort signal option PR-URL: nodejs#41777 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
This was referenced Feb 4, 2022
ruyadorno
pushed a commit
that referenced
this pull request
Feb 8, 2022
made sure top level methods aren't async/generators so that validation errors could be caught synchronously also added validation for the abort signal option PR-URL: #41777 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
This comment was marked as outdated.
This comment was marked as outdated.
targos
pushed a commit
that referenced
this pull request
Jul 12, 2022
made sure top level methods aren't async/generators so that validation errors could be caught synchronously also added validation for the abort signal option PR-URL: #41777 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
targos
pushed a commit
that referenced
this pull request
Jul 31, 2022
made sure top level methods aren't async/generators so that validation errors could be caught synchronously also added validation for the abort signal option PR-URL: #41777 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
guangwong
pushed a commit
to noslate-project/node
that referenced
this pull request
Oct 10, 2022
made sure top level methods aren't async/generators so that validation errors could be caught synchronously also added validation for the abort signal option PR-URL: nodejs/node#41777 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
made sure top level methods aren't async/generators
so that validation errors could be caught synchronously
also added validation for the abort signal option