telescope
telescope copied to clipboard
Add UI to deal with GitHub rate limiting in Dashboard
We've got a bunch of fancy new GitHub components for our posts, each of which make various calls to the GitHub API from the browser. GitHub's API is rate limited, and for unauthenticated requests:
the rate limit allows for up to 60 requests per hour. Unauthenticated requests are associated with the originating IP address, and not the user making requests.
I haven't hit this yet, but it's just a matter of time. As we scroll through posts, eventually we'll hit the 60/hour limit and the API call will fail. When that happens, our GitHub components need to render something useful to the user.
We should also consider switching to use GitHub's official JS client, which has built-in code for handling throttling and retrying rate-limited calls.
cc @Kevan-Y who hit this in the backend. NOTE: https://github.com/octokit/octokit.js works in browser and node, so we could use this in the backend too, when talking to the GitHub API.
Is this for the dashboard?
No, for the React front-end with GitHub info in the sidebar of a post. We can manage this on the server side for the Dashboard with caching in Redis.
@tcvan0707 if you cna put some details about your struggle. People will be able to help out