Skip to content
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

Database statements in new account handler may need transaction #14

Open
aantron opened this issue Dec 29, 2016 · 2 comments
Open

Database statements in new account handler may need transaction #14

aantron opened this issue Dec 29, 2016 · 2 comments
Assignees
Labels

Comments

@aantron
Copy link

aantron commented Dec 29, 2016

There is a select followed by an insert. Since promises are used (and maybe the underlying APIs are asynchronous as well), it is possible (though unlikely) that two requests will complete the select before either completes the insert. In that case, two links will be sent, but only one will be valid.

@fxfactorial
Copy link
Owner

Nice catch! Yes, I think it should be done with a transaction.

@khajvahmac
Copy link

You can make the email field unique and catch errors after insert statement. Not sure how transactions can help here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants