Title : Handled API response 403. Added visual elements with better information for the user.
Description:
Added a countdown timer when the API limit is breached. The timer counts down till when the rate-limit will reset and the user can start making requests again. Time is calculated from the response header "x-ratelimit-reset" which is received when the API limit is breached along with http status code 403.
Further Context:
The API responds with a 403 Forbidden because beyond 10 requests per minute (which is the rate-limit for unauthenticated requests), it expects the requests to be authenticated. The ideal way to handle this would be to make the user login into GitHub before they can start searching, but this solution seems repelling for someone who is just on the website to check out "mini" challenges. In that case, the committed solution seems best to me.
Error handling. Issue #330
Title : Handled API response 403. Added visual elements with better information for the user.
Description:
Added a countdown timer when the API limit is breached. The timer counts down till when the rate-limit will reset and the user can start making requests again. Time is calculated from the response header "x-ratelimit-reset" which is received when the API limit is breached along with http status code 403.
Further Context:
The API responds with a 403 Forbidden because beyond 10 requests per minute (which is the rate-limit for unauthenticated requests), it expects the requests to be authenticated. The ideal way to handle this would be to make the user login into GitHub before they can start searching, but this solution seems repelling for someone who is just on the website to check out "mini" challenges. In that case, the committed solution seems best to me.
Video of the implemented solution: https://github.com/sadanandpai/frontend-mini-challenges/assets/67118535/202e6bd7-f0ca-4838-9fa2-96b89546515b
Issue No. : #330
Code Stack : React
Close #330
Checklist:
README.md