You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(shared): compare prerelease versions without locale or precision loss - #32169
Prerelease versions were ordered with locale collation and floating-point parsing. This can put Z after a, or treat distinct large numeric identifiers as equal, affecting update/version comparisons.
Change
Compare text identifiers by code point and numeric identifiers with BigInt. Extend the existing prerelease regression case to cover both failures.
Scope and approval
A small, focused fix for an obvious version-ordering bug. It corrects prerelease comparisons in the existing helper and its regression case, without introducing a new version policy or product behavior.
Verification
Validation: regression failed before the fix; vp test run packages/shared/src/semver.test.ts and vp run check:changed pass (format, lint, knip, affected-package typechecks, adjacent tests).
No actionable comments were generated in the recent review.
Walkthrough
Prerelease comparison now uses BigInt for numeric identifiers and direct string ordering for nonnumeric identifiers. Tests add cases for uppercase and lowercase ordering, hyphenated identifiers, and large numeric identifiers.
Numeric identifiers are compared with BigInt. Nonnumeric identifiers use direct string ordering. Tests cover case-sensitive ordering, hyphenated identifiers, and large numeric values.
Reviewing files that changed from the base of the PR and between bdb8d5d and 6619109.
Files selected for processing: 2
packages/shared/src/semver.test.ts
packages/shared/src/semver.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
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
size:XS0-9 changed lines (additions + deletions).vouch:unvouchedPR author is not yet trusted in the VOUCHED list.
1 participant
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
Prerelease versions were ordered with locale collation and floating-point parsing. This can put
Zaftera, or treat distinct large numeric identifiers as equal, affecting update/version comparisons.Change
Compare text identifiers by code point and numeric identifiers with BigInt. Extend the existing prerelease regression case to cover both failures.
Scope and approval
A small, focused fix for an obvious version-ordering bug. It corrects prerelease comparisons in the existing helper and its regression case, without introducing a new version policy or product behavior.
Verification
Validation: regression failed before the fix;
vp test run packages/shared/src/semver.test.tsandvp run check:changedpass (format, lint, knip, affected-package typechecks, adjacent tests).Model: gpt-6.1-sol. Harness: Codex in T3 Code.