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

Bug : Fix race conditions in the signup endpoint. #118

Open
epicadk opened this issue Mar 6, 2021 · 5 comments
Open

Bug : Fix race conditions in the signup endpoint. #118

epicadk opened this issue Mar 6, 2021 · 5 comments
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug. Open Source Hack Status: Available Issue was approved and available to claim or abandoned for over 3 days.

Comments

@epicadk
Copy link
Member

epicadk commented Mar 6, 2021

Describe the bug

If two users send requests to the register endpoint at the same time and both have the same username/emailID then the backend will crash.

To Reproduce
Kind of hard to do this however it can be done programmatically as explained here

Expected behavior

The app should not crash and instead return an error saying that the username is already taken to one of the users and register the other successfully.

Same as anitab-org/mentorship-backend#1019

@welcome
Copy link

welcome bot commented Mar 6, 2021

Hello there!👋 Welcome to the project!💖

Thank you and congrats🎉for opening your very first issue in this project. AnitaB.org is an inclusive community, committed to creating a safe and positive environment.🌸 Please adhere to our Code of Conduct.🙌 You may submit a PR if you like! If you want to report a bug🐞 please follow our Issue Template. Also make sure you include steps to reproduce it and be patient while we get back to you.😄

Feel free to join us on AnitaB.org Open Source Zulip Community.💖 We have different streams for each active repository for discussions.✨ Hope you have a great time there!😄

@epicadk
Copy link
Member Author

epicadk commented Mar 6, 2021

If this is valid I would like to work on this : ).

@NenadPantelic
Copy link
Contributor

This is not the only race condition case we have 🙂. #83 will support this, but we need to recode controller logic.

@epicadk
Copy link
Member Author

epicadk commented Mar 6, 2021

This is not the only race condition case we have 🙂. #83 will support this, but we need to recode controller logic.

Yes I did read that however I thought that would be limited to adding constraints in the database and this would fix the race conditions. Because even in mentorship we do have constraints and still have race conditions present. That's why I think this is a valid issue. What do you think?

@NenadPantelic
Copy link
Contributor

We definitely need database constraints, based on them, we will get integrity errors we should catch and return meaningful messages with status code.

@epicadk epicadk added Category: Coding Changes to code base or refactored code that doesn't fix a bug. Open Source Hack Status: On Hold Issue or PR needs more info, a discussion, a review or approval from a Maintainer/Code Owner. Status: Available Issue was approved and available to claim or abandoned for over 3 days. and removed Status: On Hold Issue or PR needs more info, a discussion, a review or approval from a Maintainer/Code Owner. labels Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug. Open Source Hack Status: Available Issue was approved and available to claim or abandoned for over 3 days.
Projects
None yet
Development

No branches or pull requests

2 participants