GeezerVison is showing github.com — Retry version check on transient proxy failures by jojinkb · Pull Request #195 · bootdotdev/bootdev
Conversation
jojinkb
commented
Jun 15, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Fixes #196
Problem
bootdev status — and the background update check that runs on every command via version.FetchUpdateInfo — intermittently fails with:
Unable to check version status
Error: failed to fetch latest version
The failure is transient (reproduces ~1 in 4 runs on my network). Instrumenting getLatestVersion shows the real cause is a dropped connection to the Go module proxy:
Get "https://proxy.golang.org/github.com/bootdotdev/bootdev/@latest": read tcp ...:443: read: connection reset by peer
getLatestVersion has no resilience to this:
- No retry — a single connection reset fails the whole check.
- No effective fallback — the proxy list is
[proxy.golang.org, direct], but direct is (correctly) skipped since @latest can't be fetched from it over HTTP, so proxy.golang.org is effectively the only source.
- No timeout on
http.Get, so a stalled connection can hang.
- The underlying error is swallowed and the HTTP status is never checked, so a non-200 body (or a
200 without a Version field) is indistinguishable from a real failure, and the user only ever sees the generic message.
Fix
- Retry each proxy up to 3 times with a short backoff before giving up — directly addresses the transient connection resets.
- Use an
http.Client with a 10s timeout instead of bare http.Get.
- Check for HTTP
200 and reject empty-version responses.
- Wrap the underlying error into the returned one so
bootdev status surfaces the real cause instead of an opaque message.
No change in behavior on the happy path; the version string returned is identical.
Tests
Added version/version_test.go (httptest-based, no network) covering:
fetchLatestFromProxy: success, non-200, invalid JSON, empty version
fetchLatestWithRetry: recovery after a transient dropped connection
go test ./... passes locally.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.