coursetable icon indicating copy to clipboard operation
coursetable copied to clipboard

Race condition in API

Open Josh-Cena opened this issue 1 year ago • 0 comments

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 twice
  • Unique 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

Josh-Cena avatar Apr 03 '24 19:04 Josh-Cena