Skip to content

v0.1.9: fix prerelease comparison treating rc.10 as older than rc.9#13

Merged
StuartMeeks merged 1 commit into
mainfrom
fix-prerelease-numeric-ordering
Jun 1, 2026
Merged

v0.1.9: fix prerelease comparison treating rc.10 as older than rc.9#13
StuartMeeks merged 1 commit into
mainfrom
fix-prerelease-numeric-ordering

Conversation

@StuartMeeks
Copy link
Copy Markdown
Owner

Problem

pl-app update --prerelease on 0.5.0-rc.9 reported "Already up to date" against a 0.5.0-rc.10 release:

Current version: 0.5.0-rc.9
Latest release: v0.5.0-rc.10
Already up to date.

Cause

UpdateChecker.ComparePrerelease used string.CompareOrdinal, which compares "rc.9" vs "rc.10" character-by-character. '9' (0x39) sorts after '1' (0x31), so it concluded rc.9 was newer than rc.10.

Fix

Prerelease comparison now follows Semantic Versioning §11:

  • dot-separated identifiers compared left to right
  • numeric identifiers compared numerically (so rc.10 > rc.9)
  • numeric identifiers rank below alphanumeric
  • a longer identifier set outranks a shorter one with an equal prefix (beta.1 > beta)

Added test cases for the exact reported scenario plus the surrounding semver rules. All 196 tests pass.

Also

  • Bumped all NuGet dependencies to their latest versions (Microsoft.Extensions.* → 10.0.8, SourceLink → 10.0.300, test stack → latest). Tests green and the Release package builds clean.

🤖 Generated with Claude Code

ComparePrerelease used string.CompareOrdinal, which orders "rc.9" after
"rc.10" character-by-character ('9' > '1'), so `update --prerelease` on
0.5.0-rc.9 reported "Already up to date" against a 0.5.0-rc.10 release.
Comparison now follows Semantic Versioning §11: dot-separated prerelease
identifiers compare left to right, numeric identifiers compare numerically,
numeric ranks below alphanumeric, and a longer identifier set outranks a
shorter one with an equal prefix.

Also bumps all NuGet dependencies to their latest versions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@StuartMeeks StuartMeeks merged commit 2c327e1 into main Jun 1, 2026
4 checks passed
@StuartMeeks StuartMeeks deleted the fix-prerelease-numeric-ordering branch June 1, 2026 12:28
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