Skip to content

Don't fail repository fetch when remote is unreachable - #121

Open
justinleveck wants to merge 1 commit into
chrkaatz:mainfrom
justinleveck:fix/graceful-remote-fetch-failure
Open

Don't fail repository fetch when remote is unreachable#121
justinleveck wants to merge 1 commit into
chrkaatz:mainfrom
justinleveck:fix/graceful-remote-fetch-failure

Conversation

@justinleveck

Copy link
Copy Markdown

Summary

  • git fetch --all --prune in the repository "fetch changes" route wasn't wrapped in its own error handling, so a dead remote, expired SSH key, or offline network took down the entire request with a 500, even though the local repo (which is all the analytics endpoints actually read) was perfectly fine.
  • Catches the fetch failure specifically, skips the pull step when fetch didn't succeed, and falls back to reporting on local data with a fetchError message - additive, non-breaking response field, following the same pattern the client already uses for pullError.

Test plan

  • tsc --noEmit clean on server/
  • Full server test suite passes (the one formatWeek failure in src/git/__tests__/utils.test.ts is pre-existing/timezone-sensitive and reproduces identically on a clean main checkout - unrelated to this change)

git fetch was not wrapped in its own error handling, so a dead remote,
expired SSH key, or offline network took down the entire "fetch
changes" request even though the local repo (which is all the
analytics endpoints actually read) was perfectly fine.

Catch the fetch failure specifically, skip the pull step when fetch
didn't succeed, and fall back to reporting on local data with a
fetchError message - the client already surfaces pullError the same
way, so this is an additive, non-breaking response field.
@justinleveck
justinleveck force-pushed the fix/graceful-remote-fetch-failure branch from 185f063 to 1711ae3 Compare August 7, 2026 02:53
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.

1 participant