Skip to content
This repository has been archived by the owner. It is now read-only.

Webhook retry mechanic bug #2140

Closed
1 of 3 tasks
Werseter opened this issue May 8, 2019 · 3 comments
Closed
1 of 3 tasks

Webhook retry mechanic bug #2140

Werseter opened this issue May 8, 2019 · 3 comments
Labels
Milestone

Comments

@Werseter
Copy link

@Werseter Werseter commented May 8, 2019

Summary

Currently, the mechanic allowing multiple attempts to send a webhook mechanic has a bug, that overwrites the request data with the response, rendering every attempt latter than the first one to send an incorrect request.

Reproduction Steps

For example, sending executing multiple webhooks executions in short succession, triggering ratelimiting asynchronous sleep period.

Expected Results

We are supposed to still send the same request we tried to send prior to retrying.

Actual Results

Server response is fed back. This can cause multitude of errors, i.e 'Cannot send an empty message' due to last response from 'X-Ratelimit-Remaining' being empty prior to continuing.

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

System Information

  • discord.py version: latest commit 792b318 (running from source)
  • Python version: Python 3.6
  • Operating system: Windows 8.1
@Rapptz
Copy link
Owner

@Rapptz Rapptz commented May 11, 2019

I believe this is an issue with Discord rather one with the library.

Discord has done this from time to time before, whether with the library doing it or something like curl or requests alone.

Loading

@Werseter
Copy link
Author

@Werseter Werseter commented May 11, 2019

I didn't find time to make a PR from PC but the fix is a simple manner of renaming data to response inside the loop so the original data that we send through the webhook doesn't get overwritten when retrying.

Loading

@Rapptz
Copy link
Owner

@Rapptz Rapptz commented May 11, 2019

Oh I see what you're referring to. It got conflated with the curl-related issue I've seen before, e.g. https://canary.discordapp.com/channels/336642139381301249/336642776609456130/576496506983677953

Loading

@Rapptz Rapptz added the bug label May 11, 2019
@Rapptz Rapptz added this to the v1.2 milestone May 11, 2019
@Rapptz Rapptz closed this in 8206982 May 11, 2019
yagomichalak pushed a commit to yagomichalak/discord.py that referenced this issue May 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants