vsTerminus / Mojo-Discord

Perl Modules that implement parts of the Discord API. Intended for Text Chat Bots.
MIT License
33 stars 10 forks source link

Rate Limiting not working correctly #14

Open vsTerminus opened 4 years ago

vsTerminus commented 4 years ago

Reported by @incognico - Bot thinks it is rate limited when it isn't and fails to resend the rate limited message(s).

incognico commented 4 years ago

Retry-After is only sent on 429

CollinMendia commented 4 years ago

@incognico how did you come upon this bug?

incognico commented 3 years ago
[2021-11-12 11:45:41.44459] [325482] [warn] [REST.pm] [_rate_limited] Route "GET /channels/615139520135954453" is rate limited. Reset In 1 seconds
[2021-11-12 11:45:41.44473] [325482] [warn] [REST.pm] [delete_all_reactions] Route is rate limited. Trying again in 1 seconds
[2021-11-12 11:45:42.44295] [325482] [warn] [REST.pm] [_rate_limited] Route "GET /channels/615139520135954453" is rate limited. Reset In 1 seconds
[2021-11-12 11:45:42.44322] [325482] [warn] [REST.pm] [delete_all_reactions] Route is rate limited. Trying again in 1 seconds
[2021-11-12 11:45:42.44555] [325482] [warn] [REST.pm] [_rate_limited] Route "GET /channels/615139520135954453" is rate limited. Reset In 1 seconds
[2021-11-12 11:45:42.44570] [325482] [warn] [REST.pm] [delete_all_reactions] Route is rate limited. Trying again in 1 seconds
[2021-11-12 11:45:43.44382] [325482] [warn] [REST.pm] [_rate_limited] Route "GET /channels/615139520135954453" is rate limited. Reset In 1 seconds
[2021-11-12 11:45:43.44392] [325482] [warn] [REST.pm] [delete_all_reactions] Route is rate limited. Trying again in 1 seconds
[2021-11-12 11:45:43.44611] [325482] [warn] [REST.pm] [_rate_limited] Route "GET /channels/615139520135954453" is rate limited. Reset In 1 seconds
[2021-11-12 11:45:43.44616] [325482] [warn] [REST.pm] [delete_all_reactions] Route is rate limited. Trying again in 1 seconds

There seems to be a problem with the timing. Quick fix could be to just add one second to all rate limits.