elk
elk copied to clipboard
Hashtag query causing rate limit throttling
Pre-Checks
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- [X] Providing a screenshot or video to reproduce the issue or show visually what was meant.
- [ ] I am willing to provide a PR.
Describe the bug
I wrote a post that contained a hashtag (#elkzone
). I saw the upper-left hashtag pane flicker. When I clicked "Publish", the screen flashed and nothing happened. In the console, I saw logs with a MastoHttpRateLimitError:
On the server were many (over 100) identical lines of
Rate limit hit (throttle): 70.229.193.23 GET /api/v2/search?q=elkzone&type=hashtags&limit=25&resolve=false&exclude_unreviewed=true
At the time, I had two Elk windows open so that I could write the post about Elk while looking through the interface.
Reproduction video or screenshot
(Included inline in description)
Additional Context
Client: Fedora 37 Linux, Firefox 108.0.1 Server: Glitch-soc
Start a new pull request in StackBlitz Codeflow.
I had the same thing happen to me. The server admin graciously raised the API throttle cap from 300 (hits in 5 mins) to 600, but it's really not nice behavior to be doing this.
I'm happy to provide a snippet of server logs if needed, btw.
Maybe we should start caching requests using @tanstack/vue-query?
I ran into a similar issue today, and I think it would be helpful to report the cool-off time to the user instead of showing ERROR: MastoHttpRateLimitError: Too many requests
. Based on my interactions with the official Mastodon front-end, I believe the error response includes information about when the rate limit will be lifted?
If this is the case, then maybe a quick fix is to at least provide more information to the end user so that they know when they can continue using the service as normal.
I think this hits because of a bug in at least some cases, in which case the app probably isn't in a state to back off on its own? Going through a caching layer that knows how to dedupe requests might mitigate the bug (if I'm right) and even make such bugs easier to identify and fix, I would think.
FWIW, Eugen just merged this commit to Mastodon main that will increase the rate limit significantly for app tokens and user tokens: https://github.com/mastodon/mastodon/commit/c6ef56fd5e8f2648a256ae1479ddc28d0164c602
hit me just now on notifications tab and then home feed
ERROR: MastoHttpRateLimitError: Too many requests
I haven't seen this happen again. I'm guessing that the behavior was a side effect of some other bug that has since been addressed.