You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thanks for HE, it's a pretty neat package!!!
I've been playing around with hyper-express lately and created a middleware to log slow requests. While working on that, I noticed that canceling requests on the client-side doesn't trigger the close event.
// Not canceled
GET /slow [STARTED]
timeout cleared
GET /slow [FINISHED] 5,010.347 ms
GET /slow [CLOSED] 5,038.359 ms
-
// Canceled
GET /slow [STARTED]
GET /slow [CLOSED] 1,979.817 ms
timeout cleared
// Not canceled
GET /slow [STARTED]
timeout cleared
GET /slow [FINISHED] 5,003.439 ms
GET /slow [CLOSED] 5,033.814 ms
-
// Canceled
GET /slow [STARTED]
timeout cleared
Cheers \w
The text was updated successfully, but these errors were encountered:
Hey! I'm glad you like the package. So the whole event system is getting re-done in the upcoming 6.0.0 update which will be released soon in which the network events follow the Node.js spec (Same as Express.js) with some additional events implemented on top. If you would like to achieve this with the current version, You can set a hook/event handler for the "disconnect" event as that event is triggered for both a client-side abort or server-side response completion.
First of all, thanks for HE, it's a pretty neat package!!!
I've been playing around with hyper-express lately and created a middleware to log slow requests. While working on that, I noticed that canceling requests on the client-side doesn't trigger the
close
event.This test project was set up with:
Express.js example
https://gist.github.com/bulletinmybeard/02f5be3e2a9e8e92bbed6b8976ec42bb
Hyper-Express example
https://gist.github.com/bulletinmybeard/f5620ba22a32d4e2bc020f72cb0f2d1e
Cheers \w
The text was updated successfully, but these errors were encountered: