Skip to content

fix: prevent GitHub releases check from blocking app on API failure#5807

Open
ajnart wants to merge 2 commits into
devfrom
fix/github-releases-api-fallback
Open

fix: prevent GitHub releases check from blocking app on API failure#5807
ajnart wants to merge 2 commits into
devfrom
fix/github-releases-api-fallback

Conversation

@ajnart
Copy link
Copy Markdown
Member

@ajnart ajnart commented May 28, 2026

Summary

  • Add optional fallbackToStaleOnError to the cached request handler so failed upstream fetches can return last-known-good Redis data instead of throwing
  • Harden the update checker against GitHub API failures (401, quota exhausted, unreachable): disable Octokit throttling for fast failure, extend cache TTL to 24h, and enable stale fallback
  • Reduce GitHub API pressure by running the update checker cron daily and respecting cache TTL instead of force-refreshing every hour

Closes #5786

Context

Users reported Homarr becoming completely inaccessible when the GitHub releases endpoint returns quota errors — especially visible in regions where GitHub is unreliable. The update checker was hitting GET /repos/homarr-labs/homarr/releases too often and Octokit would retry throttled requests, blocking admin page loads.

Test plan

  • NODE_ENV=development pnpm exec vitest run packages/request-handler/src/test/update-checker.spec.ts
  • Verify admin dashboard loads when GitHub API is unreachable (no update indicator shown, no page hang)
  • Verify update indicator still appears when GitHub API is reachable and a newer release exists
  • Verify stale cached update data is served when GitHub fails after a prior successful fetch

@ajnart ajnart requested a review from a team as a code owner May 28, 2026 10:19
@ajnart ajnart force-pushed the fix/github-releases-api-fallback branch from 72597de to 6e88ae5 Compare May 28, 2026 13:52
@Meierschlumpf
Copy link
Copy Markdown
Member

This one seems of (119 files for a small bugfix should not be necessary). It seems like you have unrelated changes in this pr

@ajnart
Copy link
Copy Markdown
Member Author

ajnart commented May 28, 2026

This one seems of (119 files for a small bugfix should not be necessary). It seems like you have unrelated changes in this pr

I'm very confused how it got this bad, I'll fix it asap

Fallback to stale Redis cache when the GitHub releases fetch fails, reduce
check frequency to daily, and disable Octokit throttling for reliability.
@ajnart ajnart force-pushed the fix/github-releases-api-fallback branch from 3ed1adb to 28dd9dc Compare May 29, 2026 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Occasionally unable to open Homarr — GitHub API request quota exhausted even after providing token

2 participants