fix: offer update from prerelease build to formal release - #115
Merged
Conversation
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
force-pushed
the
fix/update-check-prerelease
branch
from
July 28, 2026 01:43
a74f405 to
0154071
Compare
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.
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.UpdateCheckServiceparsed the running version withSystem.Version.TryParse, which cannot parse a SemVer prerelease suffix. Parsing failed, the check returnedError, and versions were never compared. Even if it had parsed,System.Versionhas no notion of "prerelease precedes release".Fix
TryParseRunningVersion— tolerant parse that strips+buildmetadata, splits off the-prereleasesuffix, 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 so1.9and1.9.0compare equal.x.y.ztags are eligible).Tests
New
UpdateCheckServiceTestscovers prerelease→formal, v-prefix,+buildmetadata, equal/older versions, and unparseable input — 11 cases, all passing.