-
Notifications
You must be signed in to change notification settings - Fork 746
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
Race condition issue? #44
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there – awesome project!
I'm wondering if there's a small bug around this code.
When the
if
statement matches, an attempt is made to update the user before passing it along todone
. However, the call todone
immediately after theif
statement will likely always resolve before the update to the user completes.This probably wouldn't affect some applications, because the update call is getting instantiated. But the middleware is likely moving onto to the next middleware a little earlier than expected.
Another consequence of this is that
done
will get called twice, which I'm pretty sure goes against the contract of howdone
is intended to be used.I'm thinking it should instead be:
This issue likely affects the other services' code, too. What do you think?
The text was updated successfully, but these errors were encountered: