coursetable
coursetable copied to clipboard
Race condition in API
There are a lot of Sentry errors because someone could click the button twice in a row which causes DB write failure, or missing records, etc. Common examples:
NO_FRIEND_REQUEST: caused by clicking accept friend req twiceUnique constraint failed on the constraint: `netId_crn_season_worksheetNumber`: caused by adding the course twice (I think)
We should fix this on both backend and frontend:
- On backend, debounce all requests by (userID, payload)
- On frontend, change button into loading state until a response is received