ddnet / ddnet-discordbot

10 stars 12 forks source link

Duplicate ticket number #85

Open Learath2 opened 2 months ago

Learath2 commented 2 months ago

https://github.com/ddnet/ddnet-discordbot/blob/ac4e07d1c9e1006f8cef39b292decb16812f95ef/cogs/ticketsystem/buttons.py#L44

Need to wrap this function with a lock

murpii commented 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.

Learath2 commented 1 month ago

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?

murpii commented 1 month ago

Locking this particular function would ensure the counter increments correctly, but it wouldn't prevent the creation of two separate channels, right?