Skip to content

Isssues with idempotency #239

Description

@Albin-Rohde

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:
2022-03-30_17-04

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".

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions