-
Notifications
You must be signed in to change notification settings - Fork 341
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
"Callback was already called" bug #437
Comments
ctaschereau
pushed a commit
to boreal-is/connect-mongo
that referenced
this issue
Sep 7, 2021
mingchuno
added a commit
that referenced
this issue
Sep 17, 2021
2 tasks
mingchuno
added a commit
that referenced
this issue
Sep 17, 2021
4.6.0 released |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
At this line in the set function, we can see that the callback is in fact inside the try statement. This has the side effect that if some code throws immediately after calling the set function, we will fall inside the catch statement of the set function and then have an "Callback was already called" error.
connect-mongo/src/lib/MongoStore.ts
Lines 399 to 404 in 3e27376
example code :
I have tested just moving the "callback" outside of the try/catch statement (and adding a return after the callback that is inside the catch) and the behaviour appears to be correct. I'll try and find the time to submit a proper pull request this weekend.
The text was updated successfully, but these errors were encountered: