Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
stream: use synchronous error validation & validate abort signal option#41777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stream: use synchronous error validation & validate abort signal option #41777
Uh oh!
There was an error while loading. Please reload this page.
Conversation
nodejs-github-bot commented Jan 30, 2022
Review requested:
|
49b4925 to 347b307CompareUh oh!
There was an error while loading. Please reload this page.
benjamingr left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 2e4f992Compare
benjamingr left a comment • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good 🙇
Requesting CI: but I suspect it won't pass and there will be a few lint errors but I want to see the tests themselves passing :)
nodejs-github-bot commented Jan 31, 2022
nodejs-github-bot commented Jan 31, 2022
| if(options?.signal!=null){ | ||
| validateAbortSignal(options.signal,'options.signal'); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be simplified to validateAbortSignal(options?.signal, 'options.signal') (also in other places)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good to know 👍
| 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/); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these two should probably have .then(common.mustCall()) (e.g. like you did in test-stream-some-every)
LinkgoronFeb 3, 2022 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also add it to the two lines above them (that you didn't add).
nodejs-github-bot commented Feb 3, 2022
Landed in 06625ff |
iMoses commented Feb 3, 2022
@Linkgoron would you like me to take care of your notes in a future PR? |
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 <[email protected]> Reviewed-By: Nitzan Uziely <[email protected]>
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 <[email protected]> Reviewed-By: Nitzan Uziely <[email protected]>
This comment was marked as outdated.
This comment was marked as outdated.
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 <[email protected]> Reviewed-By: Nitzan Uziely <[email protected]>
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 <[email protected]> Reviewed-By: Nitzan Uziely <[email protected]>
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 <[email protected]> Reviewed-By: Nitzan Uziely <[email protected]>
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