fix(update): allow stable updates from older previews - #871
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughChangesPreview update comparison
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc0a569c17
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (channel === "latest") { | ||
| const l = parseStable(latest); | ||
| const c = parseStable(current); | ||
| const c = parseStable(current) ?? parsePreview(current)?.slice(0, 3); |
There was a problem hiding this comment.
Parse multi-component preview identifiers
When the installed build has a supported multi-component prerelease such as 2.8.2-preview.20260731.2, parsePreview() rejects it because its regex permits exactly one numeric component after preview. The release tooling accepts this form, and tests/release-notes.test.ts explicitly exercises same-day suffixes such as .2 and .10; consequently this branch still returns false and the GUI/API reports already_latest even when stable 2.9.1 is available. Parse the core independently of the complete prerelease identifier, or allow all supported numeric components, and cover this form in the update tests.
Useful? React with 👍 / 👎.
Summary
major.minor.patchcore when the selected update channel islatest.Problem
An older preview install such as
2.8.2-preview.20260731cannot be parsed by the stable-only current-version branch. With npmlatestat2.9.1,isNewer()therefore returnsfalse, and the dashboard incorrectly reportsalready_latestand disables one-click update.Behavior
latest=2.9.1,current=2.8.2-preview.20260731: update available.latest=2.9.1,current=2.9.1-preview.20260731: no update, preserving the existing core-version comparison policy.latesttarget remains rejected.Verification
bun test tests/update-notify.test.ts tests/update-job.test.ts: 60 passed, 0 failed, 152 assertions.bun run typecheck: passed.bun run privacy:scan: passed.git diff --check upstream/dev...HEAD: passed.No documentation change is included because this restores the documented existing update-channel behavior rather than adding a new user-facing option.
Summary by CodeRabbit
Bug Fixes
Tests