Uh oh!
There was an error while loading. Please reload this page.
[x] http: added closed property - #28621
Conversation
847be88 to
a554a24CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
d5bb19f to
02b82d8CompareBridgeAR
commented
Jul 11, 2019
@nodejs/http PTAL |
0321930 to
49ab8faCompareronag
commented
Jul 12, 2019
I've got a lot of other pending fixes and PR's that depend on this. Would be nice to get it merged before I start "spamming" with new PR's. |
Trott
commented
Jul 13, 2019
@nodejs/collaborators This could use some reviews. |
sebdeckers
left a comment
There was a problem hiding this comment.
Nice, LGTM. Would be great if there were docs and a test for the added http2 compat properties.
benjamingr
left a comment
There was a problem hiding this comment.
The code changes look good but I am just not sure we should do this. It adds another property and I am really not sure why we need it vs. just listening to an event. An extra variable for every single http request for something I don't understand isn't something I'm comfortable approving. Can you motivate this?
@benjamingr Because currently, there is no way to check whether an http object is closed or not. If you are using a framework such as koa or similar it might already be too late to register a In summary there are cases already out in the wild which cannot solve this and are incorrectly depending on |
Also I have other pending fixes that depend on this, e.g.
|
ronag
commented
Jul 13, 2019
If you are worried about size we can also do things like: nxtedition@7355716 |
benjamingr
left a comment
There was a problem hiding this comment.
I still think .closed should be done on the framework side but the argument regarding other fixes this would enable (in particular doing work on a closed request) are a compelling enough argument to me.
Uh oh!
There was an error while loading. Please reload this page.
f8eeaee to
9bcc445Comparenodejs-github-bot
commented
Jul 14, 2019
mcollina
left a comment
There was a problem hiding this comment.
I'm not convinced of this change. I would rather prefer that we switch IncomingMessage to use the the emitClose and autoDestroy option instead, making it less of a snowflake in the stream world. I'm not sure if that is actually doable.
Uh oh!
There was an error while loading. Please reload this page.
@mcollina would it make more sense to rename |
ronag
commented
Jul 14, 2019
@mcollina I tried the |
mcollina
left a comment
There was a problem hiding this comment.
I don't see tests or docs for http2.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
45eead6 to
2f5b684Compareronag
commented
Jul 16, 2019
@mcollina you asked me to add more checks to https://github.com/nodejs/node/blob/master/test/parallel/test-http-connect-req-res.js. Those checks will actually fail since e.g. |
mcollina
commented
Jul 16, 2019
Please add tests that verifies the current behavior, having it unspecified is going to cause more issues. Add a comment on it that explain your thinking. I would also open a separate issue about it. |
@mcollina: Done, if you agree, I will add a separate PR with test that are "correct" and fail. |
| get closed() { | ||
| return this[kState].closed; | ||
| } |
There was a problem hiding this comment.
No tests have been added for these.
ronag
commented
Aug 26, 2019
Closing for now. |
This is an alternative to
finishedandonFinished.isFinishedto more accurately indicate when a request/response has completed.With this PR the frequently used
on-finishednpm package should no longer be necessary as the "same" (assumed) functionality can be achieved using the'close'event andclosedproperty.Refs: #28412
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes