telescope icon indicating copy to clipboard operation
telescope copied to clipboard

Add UI to deal with GitHub rate limiting in Dashboard

Open humphd opened this issue 3 years ago • 3 comments

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.

humphd avatar Dec 10 '21 16:12 humphd

Is this for the dashboard?

Andrewnt219 avatar Dec 10 '21 17:12 Andrewnt219

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.

humphd avatar Dec 10 '21 17:12 humphd

@tcvan0707 if you cna put some details about your struggle. People will be able to help out

tpmai22 avatar Mar 08 '22 14:03 tpmai22