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 — stream: readable stream continues to read when pushing a empty string by MoonBall · Pull Request #18211 · nodejs/node Conversation
Member
Checklist
Affected core subsystem(s)stream
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
@mafintosh From the view of a nodejs user, I think a readable stream should end if only calling But if |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I am 👎 to this change. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Yes, I'm agreeing with @mcollina as well. Stream termination should be as explicit as possible. I think we should consider having an explicit API for it at some point. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@mcollina @mafintosh My purpose may be misunderstood. I updated the test so that you can better understand it. I am so sorry for my poor english. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
We can just consider that |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Here are some automated runs: CI: https://ci.nodejs.org/job/node-test-pull-request/12611/ Anyway, if we want to relax this it needs to be done earlier: https://github.com/MoonBall/node/blob/49ed0814f2750075fb64ab167f9a129f70f37d52/lib/_stream_readable.js#L234 esplicitly checks for a string longer than zero. This check was made pretty explicit, so if we want to make this change we should edit it there. I'm not super-confident in adding cc @mafintosh? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The linter seems to have failed with:
|
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.
|
Can you also rebase on top of master? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
ok. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
eef4179 to
9547feb
Compare
|
Rebased. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@mcollina In non-objectMode, we can call I fixed that pushing |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
What happens if you push |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
CITGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1215/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@mcollina The error is: I doesn't fix it, because I think |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
9547feb to
aaf9bc7
Compare
|
@mcollina I modified the code because that |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'm not super convinced by this change, I'll have more time to review it in a week. @mafintosh can you check this? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Let me try and look into it tonight |
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.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced that changing this is the right thing to do, yet. Maybe somebody else should weight in on why.
BTW, this is semver-major.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@MoonBall @mcollina The tests doesn't pass for me when rebasing on top of latest master, do they for you? Also the test isn't completely clear still imo. Does this make it emit an empty string on read? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
My bad with the tests, was using the wrong branch. They pass. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@MoonBall what happens if you do |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@mafintosh The result is same if I |
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.
could you collect the chunks in an array and deepEqual those and the end instead of the concatenated string? That'd make it a bit easier for me (and others) to understand and show that it isn't returning an empty string here ever :)
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.
There is a misunderstanding. This change only fixed that the 'end' event isn't emitted when we push a empty string, a empty buffer or undefined.
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.
Currently, a readable stream in non-object mode doesn't inform users a empty string or a empty buffer. It is reasonable.
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 like it if the test was a bit more explicit.
result += data doesn't tell me if r.read() returns an empty buffer, which from reading the test, you might expect.
Doing result.push(data) and then on end assert.deepEquals(result, [...]) would help
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.
@mafintosh I did it.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
aaf9bc7 to
29554ed
Compare
29554ed to
77a66d3
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
CITGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1290/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Landing |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Landed as faeee11. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
PR-URL: #18211 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
PR-URL: nodejs#18211 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Ruben Bridgewater <[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.