Sometimes the server is a bit slow, which cause the user to fire away multiple of the same events before the first event is done processing.
Imagine a player sending the event vote-card 5 times in a row. The server will try to treat all of them one by one. Of course the first one will complete, the following ones will have a bit of a borked state since the databse is already updated from the first event.
Sentry: https://sentry.io/organizations/albin/issues/3010972076/?project=6171603
Sentry public link: https://sentry.io/share/issue/fef37d4d4bf54fa5b66a64cb5dd5a8f4/
Logs:

Link to logs: https://logs.fasoner.party/search?q=&rangetype=absolute&from=2022-03-28T18%3A43%3A37.000Z&to=2022-03-28T18%3A43%3A49.000Z
This will have to be investigated a bit.
We should strive to have "idempotency" in our socketHandlers. Somehow we should be able to stop this issue from happening. It could be dropping the event if we notice that it is already in process of being handled. Or in frontend block users from firing away multiple events in a short period of time "debounce-ing".
Sometimes the server is a bit slow, which cause the user to fire away multiple of the same events before the first event is done processing.
Imagine a player sending the event
vote-card5 times in a row. The server will try to treat all of them one by one. Of course the first one will complete, the following ones will have a bit of a borked state since the databse is already updated from the first event.Sentry: https://sentry.io/organizations/albin/issues/3010972076/?project=6171603
Sentry public link: https://sentry.io/share/issue/fef37d4d4bf54fa5b66a64cb5dd5a8f4/
Logs:

Link to logs: https://logs.fasoner.party/search?q=&rangetype=absolute&from=2022-03-28T18%3A43%3A37.000Z&to=2022-03-28T18%3A43%3A49.000Z
This will have to be investigated a bit.
We should strive to have "idempotency" in our socketHandlers. Somehow we should be able to stop this issue from happening. It could be dropping the event if we notice that it is already in process of being handled. Or in frontend block users from firing away multiple events in a short period of time "debounce-ing".