anitab-org / anitab-org/mentorship-backend

Bug : Race conditions in register endpoint.

Open
#1,019 2 comments 0 reactions 1 assignee Claimed by @epicadk View on GitHub
Category: Coding Type: Bug
Dominant language
Python
Stars
200
Forks
449
PR merge metrics
No merged PRs in 30d

Description

**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](https://anitab-org.zulipchat.com/#narrow/stream/222534-mentorship-system/topic/mentorship-backend/near/227497628)

**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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.