-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
http server response cannot be used in promises #5651
Comments
This doesn't seem like a node issue to me. One thing that sticks out in the code you've provided is that you're not handling the case when |
@mscdex controls does not matter because program is not stepping inside the block and actually i dont even need to worry about success because its just because of habit i have a status there in case of failure my login function changes the promise status into rejected which means the catch block will handle that just the iissue the login function never returns something while request is on the process and when it timesout programs returning the expected value and loging to the console |
so i guess this is a real bug in nodejs or particularly promises i had a similar issue with events before the promise worked only once and when the eventHandler triggered again it aint do anything i solved that by using callback approach but in this case it means me changing entire class is there a common problem with promise implementation in nodejs ? |
ranisalt/node-argon2#37 (comment) it turns out that the bug is about argon2 nodejs package so nothing to do with nodejs |
I'll reopen it for now, it might be related with the way we handle microtask queue: ranisalt/node-argon2#25 |
Closing in favour of #5691 |
https://gist.github.com/anonymous/1b48c89fb63d7cc02021
http://i.imgur.com/r6DYhH2.png
i have the code i pasted above when that user.login function runs server does nothing but waiting and when connection got timeout or terminated by user script logs the results to console i cant end the response those previous res.fails work fine just this part makes issue and unless req is terminated it does not even step inside the then block
the demo
The text was updated successfully, but these errors were encountered: