-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Description
I've seen this issue reported by many people but so far no one has been able to gather enough information to reliably explain what's going on. An example can be seen at discordjs/discord.js#7005
In summary, every now and then at a seemingly random chance it's possible that a bot's reply to an interaction fails due to an Unknown Interaction when, in reality, the reply succeeded and was shown to the user (by reply I mean a regular reply, deferred reply or update). I know this because I've been investigating this issue on a bot I manage for around a week now and I asked some users who were impacted by this.
In the following screenshots I'm logging the time it took for me to reply by subtracting the current timestamp to the interaction's created_timestamp, and then logging the time it took for the bot to receive the error by subtracting the timestamp at the time the error was received to the one before the request was submitted. You can see that the reply is sent pretty fast and in time for Discord to accept it, however, the error comes 5 seconds later, indicating some sort of issue on Discord's end.

And of course I could be faking those numbers but it would make no sense for me to do that so I'm gonna have to ask you to trust that.
I later asked the user impacted by this issue to see what the bot responded with, and they showed that the reply was indeed deferred, which means that that error was a false positive and everything worked fine on our end.
Steps to Reproduce
There are no steps to consistently reproduce this issue as it only happens randomly. What I can tell is that the error comes when the API takes too long to send the response back but actually acknowledges and processes it.
Expected Behavior
The reply is sent correctly (happening) and a success message is returned
Current Behavior
The reply is sent correctly but an "Unknown Interaction" error is thrown
Screenshots/Videos
Can only attach what I've shown above already


(Bot is thinking but in Portuguese)
Client and System Information
discord.js v14.6.0 on Node v18.11.0 running on Debian 11 (bullseye)