Skip to content

fix(update): dev build of current release no longer self-reports an upgrade#186

Merged
stuffbucket merged 1 commit into
mainfrom
fix/update-check-dev-build
Jun 25, 2026
Merged

fix(update): dev build of current release no longer self-reports an upgrade#186
stuffbucket merged 1 commit into
mainfrom
fix/update-check-dev-build

Conversation

@stuffbucket

Copy link
Copy Markdown
Owner

Symptom

A build running the current release (e.g. v0.4.35) perpetually highlights that the same version "is available for upgrade."

Root cause

A local/source sidecar is stamped `-dev+` by `scripts/build-sidecar.ts`. The update check already polls the correct channel (stable→stable, beta→beta), but within that channel the published `` ranks above the running build — because semver puts a prerelease below its release — so `isNewerVersion("0.4.35", "0.4.35-dev+sha")` returns true. The app then offers an "upgrade" to the very version it is already running.

Published builds are unaffected: a clean `0.4.35` compares equal, and a real `0.4.35-beta.2` polls the beta channel. Only `-dev+` local binaries misfire.

Fix

`src/lib/update-check.ts`: normalize the running version by stripping only the `-dev+` local suffix before the (already channel-correct) comparison. Real `-beta.N`/`-rc.N` prereleases are left intact, so they still see their release as an upgrade. The reported `current` field keeps the full string for diagnostics.

Tests

Added a `currentVersion` test-DI seam and 3 cases: dev build of current release → up to date; dev build vs a genuinely newer release → upgrade; real beta vs its release → still an upgrade. Full suite green (1031 pass / 1 skip / 0 fail).

…pgrade

A local/source sidecar is stamped <version>-dev+<sha> (build-sidecar.ts).
Within its (correct) stable channel, the published <version> then ranked
ABOVE the running build because semver puts a prerelease below its release,
so the app perpetually offered an 'upgrade' to the very version it was on.

Normalize the running version by stripping only the -dev+<sha> local suffix
before the channel comparison; real -beta.N/-rc.N prereleases are left intact
so they still see their release as an upgrade. The reported current field
keeps the full string for diagnostics.
@stuffbucket stuffbucket merged commit 389d081 into main Jun 25, 2026
3 checks passed
@stuffbucket stuffbucket deleted the fix/update-check-dev-build branch June 25, 2026 19:00
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