twilight icon indicating copy to clipboard operation
twilight copied to clipboard

Wrong bucket on ratelimiter

Open Learath2 opened this issue 3 years ago • 1 comments

I'm hitting a 429 on a create_reaction following a delete_all_reactions. Twilight puts these in two separate buckets ChannelsIdMessagesIdReactions(i) and ChannelsIdMessagesIdReactionsUserIdType(i). However testing reveals discord uses the same bucket.

Don't think it's pertinent here but I'm on Linux, and the only feature flag I'm using is tracing on twilight-http.

Minimal testcase: https://paste.pr0.tips/f1?rust Result: result

I didn't include it here but I've verified that the 3 requests all have the same x-ratelimit-bucket.

I also wanted to inquire about the possibility to use x-ratelimit-bucket to create our buckets instead of trying to guess them. I don't really see any issues with dynamically creating the buckets on responses except ones that are also present in the current solution. If there isn't a specific reason we aren't using these I could try to provide an implementation.

Learath2 avatar Jul 18 '21 19:07 Learath2

Thank you for the detailed issue!

7596ff avatar Jul 18 '21 19:07 7596ff