GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||
GeezerVison is showing github.com — string_decoder : support typed array or data view by BeniCheni · Pull Request #22562 · nodejs/node Conversation
|
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
While we're in here, does it make sense to alphabetize the list? Or is the existing ordering logical for other reasons?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think the list makes sense in that Buffer will be the most common type of argument (by far), followed by TypedArrays.
I am not sure why ArrayBufferView is listed explicitly, since currently there are (afaik) only TypedArray and DataView ABVs.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
To elaborate a bit: There's nothing in this change that breaks new Uint8Array() working in this context, so why is the test case being changed instead of a new test case being added?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't test cases be added for DataView and TypedArray? Do they even work properly? No code has been added in this PR to alter how they work with string_decoder. Were they working already or something?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I was working with the suggestion of this comment here:
[ ] string_decoder
This list is for TypedArray/DataView support only.
I was trying not to use Unit8Array. Hopefully I understood the #1826 correctly.
If this Unit8Array doesn't need to change to Buffer to align with others, I can revert this change here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Buffer extends Uint8Array, I don't think this changed anything.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Why is Uint8Array being removed here?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
From the suggestion of this comment in #1826, "string_decoder" seems to be on the list TypedArray/DataView support only. After viewing the fs PR and the child_process, I just gave my best attempt to follow the "idea" to handle string_decode.
Please let me know if I misunderstood too much off from the context of the checklist & goals from the comment.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think this is okay and somewhat consistent with how we handle it elsewhere
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Hi @BeniCheni , I think broadly we can categorize the changes for these PRs into:
TypedArrays and DataViews wherever only Buffers or Uint8Arrays were tested earlierlib and maybe lib/internal)Here, your PR is updating the errors being thrown, but is neither adding test cases nor adding functionality to work with the TypedArrays or DataViews. Please note, it might well be the case that string_decoder already works for these, but adding test cases is a way of validation for the same. Hope that helps!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🙏 for the collective reviews. Will analyze & update accordingly.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM when ArrayBufferView is removed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Researched & wrote tests to cover
Researched more and updated to revert the previously incorrect removal of
Removed any context of Also confirmed if any context needed to update in |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Reconfirming my LG
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hi @BeniCheni , thanks for updating the tests! I think we could also update |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Hi @SirR4T, updated doc per your suggestion. Notice the last CI instance failed with just a doc change in the commit. Awaiting to get help/advice from other reviewers to validate the failed CI instance. Thoughts, any reviewer(s)? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hi @BeniCheni , doc changes look good to me, thanks! But as I'm myself a new enough contributor here, I'll refrain from approving PRs, in deference to someone with more review experience. As for the CI failure, it doesn't seem related to your changes, but instead looks like a certificate failure from npm. This may or may not be related to npm's current issue at the time of this post. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
New CI: https://ci.nodejs.org/job/node-test-pull-request/16953/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Resume CI: https://ci.nodejs.org/job/node-test-pull-request/16971/ (:heavy_check_mark:) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer this test use getArrayBufferViews() to cover all possible TypedArray types and DataView. An example usage of this function by @SirR4T is
node/test/parallel/test-fs-write-file-typedarrays.js
Lines 24 to 31 in be5e396
| for (const expectView of common.getArrayBufferViews(inputBuffer)) { | |
| console.log('Sync test for ', expectView[Symbol.toStringTag]); | |
| fs.writeFileSync(filename, expectView); | |
| assert.strictEqual( | |
| fs.readFileSync(filename, 'utf8'), | |
| inputBuffer.toString('utf8') | |
| ); | |
| } |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Hi, @TimothyGu. Updated to use the common |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
If the console.log() statement is part of the test, please add a comment indicating such. If it is not, I'd prefer to use a comment instead of having the extraneous console output.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Hello @jasnell, |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ping/Dear reviewers, Would you mind helping to guide this “author ready” PR to landing? (Made all suggested updates according to previous review comments; thanks!) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
New CI: https://ci.nodejs.org/job/node-test-pull-request/17187/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Landed in e2325bc |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Refs: #1826 PR-URL: #22562 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
Refs: #1826 PR-URL: #22562 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
Refs: #1826 PR-URL: #22562 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
Refs: #1826 PR-URL: #22562 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.