You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When fetching a user's toots, the high fetch rate is bound to cause the Mastodon instance to rate-limit, which in effect causes all requests to fail with a message indicating the date and time until which rate-limiting will be lifted.
Release v0.2.0 of mastotool ignores these rate-limit responses, and therefore continues trying to fetch:
without indicating to the user that a rate limit has been hit, and
causing the instance to keep rate-limiting ad infinitum
Simple solution
Define two running states for the fetch phase: fetching and rate-limited.
Initial state is fetching.
In fetching state, upon receipt of a rate-limit response, record the end-of-limit date and time and switch to rate-limited state.
In rate-limited state, upon reaching the end-of-limit date and time, switch back to fetching state.
In fetching state, behavior, including user feedback, remains unchanged with respect to v0.2.0.
In rate-limited state, no API request is performed, and the user feedback shows the time remaining until rate limit is lifted.
Notes
This may involve modifying the go-mastodon library if it does not provide enough info to the user code about the rate-limiting responses yet.
Problem
When fetching a user's toots, the high fetch rate is bound to cause the Mastodon instance to rate-limit, which in effect causes all requests to fail with a message indicating the date and time until which rate-limiting will be lifted.
Release v0.2.0 of
mastotool
ignores these rate-limit responses, and therefore continues trying to fetch:Simple solution
fetching
andrate-limited
.fetching
.fetching
state, upon receipt of a rate-limit response, record the end-of-limit date and time and switch torate-limited
state.rate-limited
state, upon reaching the end-of-limit date and time, switch back tofetching
state.fetching
state, behavior, including user feedback, remains unchanged with respect tov0.2.0
.rate-limited
state, no API request is performed, and the user feedback shows the time remaining until rate limit is lifted.Notes
This may involve modifying the go-mastodon library if it does not provide enough info to the user code about the rate-limiting responses yet.
References
Conversion at https://mastodon.art/web/statuses/104737809996624450
The text was updated successfully, but these errors were encountered: