Open Learath2 opened 2 months ago
I believe there's a different issue at play. I've noticed that the duplicate tickets always come from the same person, as if the button interaction was sent twice.
What I could do is disable the button after it's been clicked, and then release it after the ticket is created to confirm this theory maybe.
Something something idempotency something something. But I'm fairly sure it's a locking issue, why would the second interaction ever get the old id otherwise?
Locking this particular function would ensure the counter increments correctly, but it wouldn't prevent the creation of two separate channels, right?
https://github.com/ddnet/ddnet-discordbot/blob/ac4e07d1c9e1006f8cef39b292decb16812f95ef/cogs/ticketsystem/buttons.py#L44
Need to wrap this function with a lock