-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: handle undefined chunks correctly in decode stream #55153
stream: handle undefined chunks correctly in decode stream #55153
Conversation
Align TextDecoderStream behavior with WPT requirements by treating undefined chunks as errors. This change ensures that TextDecoderStream properly handles unexpected chunk types and throws an error when receiving undefined input. This update addresses the failing WPT for decode stream error handling.
Review requested:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #55153 +/- ##
==========================================
- Coverage 88.24% 88.24% -0.01%
==========================================
Files 651 651
Lines 183930 183865 -65
Branches 35850 35823 -27
==========================================
- Hits 162311 162244 -67
- Misses 14918 14929 +11
+ Partials 6701 6692 -9
|
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.
Looks good other than throwing ERR_INVALID_THIS. ERR_INVALID_ARG_TYPE is likely a better error to be thrown here.
Thank you for the suggestion! I’ve updated the code to throw ERR_INVALID_ARG_TYPE instead of ERR_INVALID_THIS as per your recommendation. I appreciate the feedback : ) |
8020ad2
to
cc89cf2
Compare
Commit Queue failed- Loading data for nodejs/node/pull/55153 ✔ Done loading data for nodejs/node/pull/55153 ----------------------------------- PR info ------------------------------------ Title stream: handle undefined chunks correctly in decode stream (#55153) ⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile! Branch Nahee-Park:fix-text-decoder-stream -> nodejs:main Labels author ready, needs-ci, web streams Commits 2 - stream: handle undefined chunks correctly in decode stream - stream: throw ERR_INVALID_ARG_TYPE instead of ERR_INVALID_THIS Committers 1 - Nahee-Park <[email protected]> PR-URL: https://github.com/nodejs/node/pull/55153 Reviewed-By: Mattias Buelens <[email protected]> Reviewed-By: Matthew Aitken <[email protected]> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/55153 Reviewed-By: Mattias Buelens <[email protected]> Reviewed-By: Matthew Aitken <[email protected]> -------------------------------------------------------------------------------- ℹ This PR was created on Sat, 28 Sep 2024 16:09:29 GMT ✔ Approvals: 2 ✔ - Mattias Buelens (@MattiasBuelens): https://github.com/nodejs/node/pull/55153#pullrequestreview-2335819701 ✔ - Matthew Aitken (@KhafraDev): https://github.com/nodejs/node/pull/55153#pullrequestreview-2335879581 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2024-09-29T15:29:57Z: https://ci.nodejs.org/job/node-test-pull-request/62843/ - Querying data for job/node-test-pull-request/62843/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/main up to date... From https://github.com/nodejs/node * branch main -> FETCH_HEAD ✔ origin/main is now up-to-date - Downloading patch for 55153 From https://github.com/nodejs/node * branch refs/pull/55153/merge -> FETCH_HEAD ✔ Fetched commits as bbf08c6a1bef..cc89cf23dee8 -------------------------------------------------------------------------------- [main 16d27d5e63] stream: handle undefined chunks correctly in decode stream Author: Nahee-Park <[email protected]> Date: Sat Sep 28 23:40:33 2024 +0900 2 files changed, 3 insertions(+), 7 deletions(-) [main ba985b3895] stream: throw ERR_INVALID_ARG_TYPE instead of ERR_INVALID_THIS Author: Nahee-Park <[email protected]> Date: Sun Sep 29 19:07:21 2024 +0900 1 file changed, 2 insertions(+), 1 deletion(-) ✔ Patches applied There are 2 commits in the PR. Attempting autorebase. Rebasing (2/4)https://github.com/nodejs/node/actions/runs/11110112478 |
Landed in 3111ed7 |
Align TextDecoderStream behavior with WPT requirements by treating undefined chunks as errors. This change ensures that TextDecoderStream properly handles unexpected chunk types and throws an error when receiving undefined input. This update addresses the failing WPT for decode stream error handling. PR-URL: #55153 Reviewed-By: Mattias Buelens <[email protected]> Reviewed-By: Matthew Aitken <[email protected]>
Align TextDecoderStream behavior with WPT requirements by treating undefined chunks as errors. This change ensures that TextDecoderStream properly handles unexpected chunk types and throws an error when receiving undefined input. This update addresses the failing WPT for decode stream error handling. PR-URL: #55153 Reviewed-By: Mattias Buelens <[email protected]> Reviewed-By: Matthew Aitken <[email protected]>
Align TextDecoderStream behavior with WPT requirements by treating undefined chunks as errors. This change ensures that TextDecoderStream properly handles unexpected chunk types and throws an error when receiving undefined input. This update addresses the failing WPT for decode stream error handling. PR-URL: nodejs#55153 Reviewed-By: Mattias Buelens <[email protected]> Reviewed-By: Matthew Aitken <[email protected]>
Align TextDecoderStream behavior with WPT requirements by treating undefined chunks as errors. This change ensures that TextDecoderStream properly handles unexpected chunk types and throws an error when receiving undefined input. This update addresses the failing WPT for decode stream error handling. PR-URL: nodejs#55153 Reviewed-By: Mattias Buelens <[email protected]> Reviewed-By: Matthew Aitken <[email protected]>
Align TextDecoderStream behavior with WPT requirements by treating undefined chunks as errors. This change ensures that TextDecoderStream properly handles unexpected chunk types and throws an error when receiving undefined input.
This update addresses the failing WPT for decode stream error handling.