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: Two or more users can create a reservation when doing so exactly at the same time. #5

Open
robintschroeder opened this issue Jan 14, 2019 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@robintschroeder
Copy link
Contributor

When I Try to Reserve 3 things in a row the last one gets stuck as its own reservation. (torin)

@robintschroeder robintschroeder added the bug Something isn't working label Jan 14, 2019
@robintschroeder robintschroeder self-assigned this Jan 14, 2019
@legut2
Copy link

legut2 commented Jan 14, 2019

Not sure what exactly you mean but I'm assuming that you are saying that two users or more can schedule for the same time on a resource if they both put in a request for the same block of time or overlap.

Based on my understanding of what your bug is. Have each unique user be on a separate thread. Then lock the resource/file that determines the schedule as you are editing it on one thread and unlock it once it is done editing it. Other threads will be forced to wait until the first thread is done.

@robintschroeder
Copy link
Contributor Author

Hey @legut2 , thanks for your comment, but the users are on different phones. The problem is that user #1 has created a reservation and in the time that it takes to queue and set that reservation up to the API, user #2 has also made a reservation for the same resource and an over lapping time. Both go into the db. I only have validation written into the phone, the API is dumb, so I need to fix that. No worries. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants