ClintStaley / PhysicsCompetition

0 stars 0 forks source link

Transaction Management for Server/Holes in sbm history #33

Open DillonHussey opened 3 years ago

DillonHussey commented 3 years ago

Currently, the UI does not actually use the submission history because the user can only ever see the most recent submission made. If we ever change this to allow the user to view their past submissions we will have an issue with our ability to support multiple users from the same team from submitting at the same time.

We already have a team canSubmit which is used to ensure only one submission is accepted at a time, but this can be a stale value, failing to prevent users from submitting when another user has submitted. Little changes may be made here and there to reduce the window in which this bug would be possible, but it would never be fully solved without implementing a transaction management system for the server to use. This would ensure only one user at a time may complete a given transaction on the server (like a postSbm), and that all other users will be thrown errors and forced to try again, or forced to wait in some other way. From here, there are different solutions that may be implemented. It may be possible to track recent team submissions by using a locked variable in place of team.canSubmit to let the user know how many of the submissions to pull in the api.getSmbs, or the user may be forced to wait to make their own submission until the last one has been graded and returned.