vuejs / vue-issue-helper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

We sometimes get errors from the GH API because of rate limits

LinusBorg opened this issue · comments

e.g.: vuejs/vue-cli#4588

github API call fails :
api.github.com/repos/vuejs/vue-cli/releases?page=1&per_page=100 returns :

documentation_url: "https://developer.github.com/v3/#rate-limiting" message: "API rate limit exceeded for XXX.X.XXX.XXX. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)"

There's currently no error handling happening

  1. We need some error handling here:

const response = await fetch(`https://api.github.com/repos/${repo}/releases?page=${page}&per_page=100`)

  1. Assuming we can't easily/quickly get a higher rate limit from github some way, we should make sure that the issue helper works despite this, i.e. make the option field optional (...only if the versions request fails?).

  2. We could cache these version lists in localstorage so users that come back can fallback to an older list if the rate limit doesn't allow them to have an up-to-date one.

Always reaching rate limits in my company intranet, with a universal proxy....