discord / discord-api-docs

Official Discord API Documentation
https://discord.com/developers/docs/intro
Other
5.99k stars 1.26k forks source link

Webhook Followup / Unknown Webhook (404) #7220

Open AlexFlipnote opened 1 month ago

AlexFlipnote commented 1 month ago

Description

Whenever I respond to an interaction URL request with a defer, it goes through as normal, and Discord says that the "Application is thinking". However at random occurrence, whenever I wish to reply with /webhooks/:app_id/:followup_token, it would tell me that the webhook is not there (404). After making my script retry for 2-3 times in a span of ~10 seconds, it finally registers that it can reply and gets a HTTP 200 request.

Steps to Reproduce

Expected Behavior

Being able to reply to a defer instantly as shown here image

Current Behavior

Random chance to return HTTP 404 until a few seconds has passed and Discord API finally lets you reply to the followup token. WindowsTerminal_2024-10-18_01-23-58

Screenshots/Videos

They are provided above

Client and System Information

Library: discord.http (Python, Quart, aiohttp) OS: Windows 11 Pro

jhgg commented 1 month ago

When replying to an HTTP response, there is no guarantee that Discord has received the response that you sent before it received your request for a follow up.

Discord probably needs to handle a follow up for an interaction where a result has not yet been replied to as resolving the interaction, and then dropping the http response asking it to be deferred when it receives the response.

AlexFlipnote commented 1 month ago

When replying to an HTTP response, there is no guarantee that Discord has received the response that you sent before it received your request for a follow up.

Even if the client is saying that "Application is thinking", intentionally waiting 2 seconds before sending a followup, yet still getting a HTTP 404? Just asking since it feels a bit strange where the client shows that the API has accepted my defer response, yet followup token is unavailable at some random points, for a duration of 2-10 seconds (it's a bit random at times), which is after I can see that a defer has been handled by Discord.

https://github.com/user-attachments/assets/d0621988-d576-4c44-96af-0c829c274496

AlexFlipnote commented 3 weeks ago

Hey, just commenting to see if there was any followup (no pun intended) to this issue. I still get HTTP 404 errors regardless of how much delay I add on top of the response, after the Discord client does in fact show that they have processed the response I gave and have triggered a "Application is thinking..." response to the client.

Have tried to delay the followup response all from 0.5 second to 5 seconds with the same outcome in all of them:

If there is anything else I can try, please let me know, because I have exhausted everything I could think of to make it possibly work again with 0 issues. It was working completly fine with the interactions were using websocket only, but converting my bot to be using Interaction URL introduced this problem.

fb-sean commented 3 weeks ago

+1 on this as mentioned in https://discord.com/channels/613425648685547541/1245841059515207821

bdaroz commented 2 weeks ago

+1 on this as well.