fix(shared): compare prerelease versions without locale or precision loss#32169

merged2
main
GitHub fork: fix/semver-prerelease-order-nov6
opened25d agobyLluke2x
View on GitHubTwo-way sync enabledPR last imported 17d ago

Problem

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).

Model: gpt-6.1-sol. Harness: Codex in T3 Code.

Checks

22 successful ยท 19 skipped
All checks passed
2b997fa

Added 1 commit

  • fix(shared): compare prerelease versions without locale or precision loss6619109
Synced from GitHub
Codex Review Summary: โœ… Completed

This comment shows the latest Codex review activity on this pull request.

ReviewStatusCommitReview trigger
๐Ÿ“ Code Reviewโœ… Completed 2026-11-06T20:18:09.479198Z6619109PR opened
โ„น๏ธ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with ๐Ÿ‘€ while any review is running, comments if it has suggestions, and reacts with ๐Ÿ‘ once all reviews finish with no findings.

Synced from GitHub

Explain Change โ†’

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 6619109c1e54a4b7c306f463cfd90f0bc563033c and 2b997fa004217c63167b1a8fe4ab7396145b6ac5.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

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.

Changes: Prerelease comparison

Layer / File(s)Summary
Compare prerelease identifiers
packages/shared/src/semver.ts, packages/shared/src/semver.test.ts
Numeric identifiers are compared with BigInt. Nonnumeric identifiers use direct string ordering. Tests cover case-sensitive ordering, hyphenated identifiers, and large numeric values.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Suggested reviewers: romil-bijarnia

Merge Risk: Minimal ยท previous review 66191

No merge-blocking risk was identified in the prerelease comparison change.

Pre-merge checks: 4

Check nameStatusExplanation
Title checkThe title clearly describes the main change to prerelease comparison.
Linked Issues checkCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkCheck skipped because no linked issues were found for this pull request.
Description checkThe description covers the problem, change, scope, and verification. It explains the exception to prior approval and identifies the model and harness.
Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix ยท Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between bdb8d5dfc067134f460ea7757e62355fe5f9b2a7 and 6619109c1e54a4b7c306f463cfd90f0bc563033c.

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.

Added 1 commit

  • Merge remote-tracking branch 'origin/main' into fix/semver-prerelease-order-nov62b997fa

Evidence

Real web app, Chromium, en-US, 1280ร—800, light theme, fresh isolated data on both commits. Synthetic version metadata only; comparison code unchanged.

Steps: seed one synthetic project; capture the client version in Settings โ†’ About; open Settings โ†’ Sharing & access and capture the server Version row; require Copy relaunch command. Repeat identical steps on both commits for each pair below. All versions start with 1.0.0-.

Precision and ASCII reproduce on base and pass on head. Numeric and hyphen controls pass on both.

Client / serverBefore 81df733306After 2b997fa004
nightly.9007199254740993 / nightly.9007199254740992
nightly.a / nightly.Z
nightly.2 / nightly.1, control
nightly.alpha1 / nightly.alpha-1, control

Scenario, startup version fixture, run commands.

Full evidence including About captures, runner reports and sanitized logs.