-
Notifications
You must be signed in to change notification settings - Fork 1.3k
"disconnect" event on the "request" object is never emitted #3528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I tried to recreate this and succeeded. I also tried using the python What are you trying to achieve or the steps to reproduce?
What was the result you received?
What did you expect?
|
This does appear to be a bug to me. The request's close/abort listeners aren't added until transmission: Lines 269 to 290 in c212bc8
The current hapi test doesn't cause the disconnect until transmission has begun: Lines 334 to 338 in b8efbd9
It seems that the close/abort listeners that trigger the disconnect event should be moved roughly here: Lines 171 to 178 in b8efbd9
|
Thanks a lot! |
This is a simple test where I create a HAPI server with a route that replies with "hello world" after 2 seconds. The same code contains a client that does a request to the route and aborts it after 500ms.
According to the documentation the request object should emit a
disconnect
event. After debugging for a while I notice that HAPI subscribes to the event too late when the route calls thereply
function.I have tried with version
hapi@16.4.3
and node v6.Thank you very much in advance.
The text was updated successfully, but these errors were encountered: