stream: fix destroy(err, cb) regression#13156
Conversation
There was a problem hiding this comment.
Does the missing semicolon pass make lint?
There was a problem hiding this comment.
nope, I have some leftover files with linting errors under bench, and I didn't spot those :(. Updated
1f399e1 to
502bfaf
Compare
There was a problem hiding this comment.
It might be worth doing some assertion on the error received here.
502bfaf to
c294477
Compare
|
cc @lpinca |
|
CI (without linting errors): https://ci.nodejs.org/job/node-test-pull-request/8232/ |
There was a problem hiding this comment.
If this statement is important you should assert it (set a field on expected on line 177 and assert it's there in line 175).
c294477 to
f4813b1
Compare
There was a problem hiding this comment.
Personally I like it that if a function is used it's a strong indicator that you need this bound.
There was a problem hiding this comment.
This is just a plain old ES5 function. I tend to say the contrary: I use () => {} as a strong indicator that I need this to stay the same.
lib/internal/streams/destroy.js
Outdated
There was a problem hiding this comment.
IMHO If the cb should stay undocumented don't put it in the signature, extract it from arguments.
My IDE (WebStorm) will intellisense it's presence.
There was a problem hiding this comment.
IMHO we shouldn't use arguments ever unless we really need to.
There was a problem hiding this comment.
this was done in the previous PR, I would prefer to discuss that in another issue, if you want to fire a PR (I would like to get this in ASAP, keeping it only on the regression).
There was a problem hiding this comment.
Not feeling strongly about this... Just FYI.
|
P.S. take the |
Fixed a regression that caused the callback passed to destroy() to not be called if the stream was already destroyed. This caused a regression on the ws module in CITGM introduced by nodejs#12925. Fixes: websockets/ws#1118
f4813b1 to
17aebdf
Compare
|
[question] About synchronicity of the call to |
|
@refack there is not. In fact, the comment was just wrong and taken from the other place I copied those examples from. That callback should be called synchronously. |
|
@refack can you confirm this fix does not causes any more regressions, but it fixes the one I introduced? |
Waiting to the CITGM to do it's dance. |
|
Landed as ccd3ead |
Fixed a regression that caused the callback passed to destroy() to not be called if the stream was already destroyed. This caused a regression on the ws module in CITGM introduced by #12925. PR-URL: #13156 Fixes: websockets/ws#1118 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Calvin Metcalf <calvin.metcalf@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Fixed a regression that caused the callback passed to destroy() to not be called if the stream was already destroyed. This caused a regression on the ws module in CITGM introduced by #12925. PR-URL: #13156 Fixes: websockets/ws#1118 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Calvin Metcalf <calvin.metcalf@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Fixed a regression that caused the callback passed to destroy() to not be called if the stream was already destroyed. This caused a regression on the ws module in CITGM introduced by #12925. PR-URL: #13156 Fixes: websockets/ws#1118 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Calvin Metcalf <calvin.metcalf@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Fixed a regression that caused the callback passed to destroy()
to not be called if the stream was already destroyed.
This caused a regression on the ws module in CITGM, as discovered
by @refack.
Fixes: websockets/ws#1118
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
stream, net