fix(mac): a cached ETag is not an answer to "what server should I install" - #250
Merged
Conversation
…tall"
ensureRuntime resolved the runtime to install through the same release
client the background update check uses, which replays GitHub's ETag. A
304 therefore came back as an error and surfaced as
could not install the cix server: could not find a cix server to
install: not modified
with setup dead in the water. The ETag describes GitHub's release
listing — the same listing for every Mac in the world — and says nothing
about whether this machine has a runtime on disk, so the two questions
must not share a cache.
It bricked the install permanently rather than transiently: the first
launch runs one background update check, which persists the ETag to
~/.cix/launcher.json, and that file outlives both the process and a
reinstall of the app. Any launch after a first run that did not complete
setup answered every install attempt with 304, and kept doing so until
somebody published a new server release.
latestRuntime now separates them: on a 304 it takes the listing this
session already saw, and when the ETag came from an earlier run — so the
body it matched is gone — it re-asks without it, on a copy of the client
so the cached ETag survives for the cheap checks it exists for.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The bug
A fresh install of cix.app could reach a state where setup fails permanently:
ensureRuntimeresolved which server to download through the samerelease.Clientthe background update check uses. That client replays GitHub'sETag as
If-None-Match, so GitHub answers304 Not ModifiedandensureRuntimereported it as a fatal error.The ETag describes GitHub's release listing — identical for every Mac in the
world — and says nothing about whether this machine has a runtime on disk.
Why it was permanent, not transient
onReadyruns one background update check, which persists theETag to
~/.cix/launcher.json.empty database) — no runtime installed, panel shows STOPPED.
~/.cix/survives reinstalling the app, so the machine stayed unsetuppableuntil a new
server/v*release changed the listing.The fix
updater.latestRuntimeseparates the two questions. On a 304 it uses thelisting this session already saw; when the ETag came from an earlier run (so the
body it matched is gone) it re-asks without it — on a copy of the client, so
the cached ETag survives for the cheap checks it exists for.
Update checks are unchanged: there a 304 still correctly means "no news".
Tests
Two new tests in
cli/launcher/runtime_darwin_test.go, against a fake releasesAPI that honours
If-None-Match:TestLatestRuntimeIgnoresAStaleETag— an ETag seeded into prefs (the released0.1.0 failure) still resolves a release, and neither the in-memory nor the
persisted ETag is spent.
TestLatestRuntimeReusesTheListingThisSessionSaw— a 304 after a check in thesame process is answered from memory, with no extra request.
go build ./...andgo test ./launcher/ ./internal/release/pass.Workaround for anyone already stuck on 0.1.0
🤖 Generated with Claude Code