binwiederhier / ntfy

Send push notifications to your phone or desktop using PUT/POST
https://ntfy.sh
Apache License 2.0
18.1k stars 704 forks source link

Website Bug: "Application error" if api.github.com request failed #892

Open davendu opened 1 year ago

davendu commented 1 year ago

:lady_beetle: Describe the bug

When using IP shared with people, GET request to api.github.com can be rejected:

GET https://api.github.com/repos/binwiederhier/ntfy [HTTP/2 403  69ms]
{"message":"API rate limit exceeded for 43.132.98.115. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}

Lead to an Application error of ntfy.sh:

Application error: a client-side exception has occurred (see the browser console for more information).

:computer: Components impacted

ntfy website index page

:bulb: Screenshots and/or logs

Console log:

TypeError: can't access property "toString", n.stargazers_count is undefined [index-2471953fda56f166.js:1:21035](https://ntfy.sh/_next/static/chunks/pages/index-2471953fda56f166.js)
TypeError: can't access property "toLocaleString", n is undefined [framework-3b5a00d5d7e8d93b.js:9:69816](https://ntfy.sh/_next/static/chunks/framework-3b5a00d5d7e8d93b.js)
TypeError: can't access property "toLocaleString", n is undefined [main-a1df4e305e4c1ad8.js:1:9771](https://ntfy.sh/_next/static/chunks/main-a1df4e305e4c1ad8.js)

:crystal_ball: Additional context

N/A

binwiederhier commented 1 year ago

The API call for the star counter is cached for many hours, so this would be a very very rare case. Yet of course the website should not crash because of it.