Fix SemVer prerelease comparison - #173
Open
dipeshbabu wants to merge 1 commit into
Open
Conversation
dipeshbabu
marked this pull request as ready for review
July 31, 2026 08:21
dipeshbabu
force-pushed
the
agent/fix-prerelease-version-comparison
branch
from
July 31, 2026 17:54
fed2e02 to
3eda73f
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.
Summary
alpha.1/alpha-1case as regression coverageRoot cause
The update notifier compared each complete prerelease string with
Intl.Collator. Locale-aware comparison does not implement SemVer's identifier boundaries or precedence rules, so valid versions such as1.0.0-alpha-1and1.0.0-alpha.1could be ordered incorrectly.Impact
Prerelease users receive update notices only when the registry version has higher SemVer precedence. Stable-version behavior is unchanged.
Overlap check
Before publishing, open issues and pull requests were reviewed and repository-wide searches were run for
semver,prerelease,update notice, andversion comparison. No active issue or pull request overlaps this fix. The only related search hits were already-merged work that introduced the broader update-notice and release features.Validation
pnpm dlx bun test --timeout 30000 ./tests-ts/update-notice.test.ts— 10 passedpnpm exec tsc --noEmitpnpm exec prettier --check src/version.ts tests-ts/update-notice.test.tsgit diff --check