Skip to content

fix: offer update from prerelease build to formal release - #115

Merged
coldhighsun merged 1 commit into
mainfrom
fix/update-check-prerelease
Jul 28, 2026
Merged

fix: offer update from prerelease build to formal release#115
coldhighsun merged 1 commit into
mainfrom
fix/update-check-prerelease

Conversation

@coldhighsun

Copy link
Copy Markdown
Owner

Problem

When the running build is a prerelease (e.g. 1.9.0-alpha.1) and the latest published release is the corresponding formal version (1.9.0), no update was ever offered.

UpdateCheckService parsed the running version with System.Version.TryParse, which cannot parse a SemVer prerelease suffix. Parsing failed, the check returned Error, and versions were never compared. Even if it had parsed, System.Version has no notion of "prerelease precedes release".

Fix

  • TryParseRunningVersion — tolerant parse that strips +build metadata, splits off the -prerelease suffix, and reports whether the version was a prerelease.
  • IsNewerFormalRelease(running, latestFormal) — SemVer-aware comparison: higher numeric core wins; on an equal core, a formal release outranks its own prereleases. Cores are normalized to three fields so 1.9 and 1.9.0 compare equal.
  • The remote tag still uses the original strict parse (only formal x.y.z tags are eligible).

Tests

New UpdateCheckServiceTests covers prerelease→formal, v-prefix, +build metadata, equal/older versions, and unparseable input — 11 cases, all passing.

System.Version cannot parse a SemVer prerelease running version (e.g.
1.9.0-alpha.1), so the update check returned Error and never offered the
matching formal release (1.9.0). Parse the running version tolerantly and
compare with SemVer precedence via IsNewerFormalRelease, where a prerelease
is older than the formal release with the same numeric core.
@coldhighsun
coldhighsun force-pushed the fix/update-check-prerelease branch from a74f405 to 0154071 Compare July 28, 2026 01:43
@coldhighsun
coldhighsun merged commit c5a4840 into main Jul 28, 2026
3 checks passed
@coldhighsun
coldhighsun deleted the fix/update-check-prerelease branch July 28, 2026 01:44
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