Giter Club home page Giter Club logo

mastotool's People

Contributors

eest9 avatar muesli avatar tachiniererin avatar

mastotool's Issues

Development: add a pause mechanism with user feedback when hitting rate limits

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:

  1. without indicating to the user that a rate limit has been hit, and
  2. causing the instance to keep rate-limiting ad infinitum

Simple solution

  1. Define two running states for the fetch phase: fetching and rate-limited.
  2. Initial state is fetching.
  3. In fetching state, upon receipt of a rate-limit response, record the end-of-limit date and time and switch to rate-limited state.
  4. In rate-limited state, upon reaching the end-of-limit date and time, switch back to fetching state.
  5. In fetching state, behavior, including user feedback, remains unchanged with respect to v0.2.0.
  6. 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.

References

Conversion at https://mastodon.art/web/statuses/104737809996624450

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.