Kord-Extensions/kord-extensions

`PKMessageCreateEvent` occasionally fires twice due to low delay with slower PK times

SilverAndro opened this issue · 7 comments

Description

The PKMessageCreateEvent occasionally fires twice due to low delay and/or slower PK times

Reproduction

Inconsistent due to factors outside of a testing environment's control

Suggestions

Additionally, switching the logic to watching for a new, proxied message rather than the deletion of the old one may improve detection, as PK will not delete the message until it knows that a proxied one has been sent successfully.

Hello, and thanks for opening an issue! As this is the first time you've created an issue on this repository, we'd just like to offer you a warm welcome to the project, and the following pointers:

  • Most importantly, all issues must adhere to our Code of Conduct. Please give it a quick read if you haven't already.

  • While our team is passionate about the projects we've created here, we're all volunteers. Please don't be offended if it takes time for us to get to your issue - we'll be here as soonas we can be!

  • Please provide as much information as possible when asking a question, reporting a problem, or submitting a feature request. This will help us to address your issue quickly and efficiently. If you forgot to add some information, no worries - feel free to edit the issue and add anything you missed!

    Thanks for contacting us! If you have any further questions, please feel free to join us on Discord in the #dev-kotdis channel (or #kordex-discussion for Kord Extensions projects), or to contact a staff member directly.

switching the logic to watching for a new, proxied message rather than the deletion of the old one...

How do you propose this should work? I don't really see it changing too much, given that you can't take back an event, and we'd still need to wait for that message to appear.

I don't believe it would completely solve it, but watching for a new one instead would reduce the amount of time until a proxy is "finished" which would hopefully bring down the average time to wait, since youre cutting out waiting for another interaction from PK after the proxied version is sent.

Basically I'm not aware of anything particularly special about the deletion other than being a last step, all the information should be available once the webhook message is available, to my understanding

(Although it does occur to me that may cause issues with reproxy? I don't think it would be too significant though)

For the time being, I'm just going to add one second to the delays, since I can't really motivate myself to rewrite this thing at the moment

Fair enough

That should be in the latest push, which will be available in around 15 minutes.

Yep seems to work, thanks much