Fix Canvas reorder offset overflow - #8141
austinywang wants to merge 14 commits into
Conversation
…ortcuts # Conflicts: # cmux.xcodeproj/project.pbxproj
…ortcuts # Conflicts: # Packages/Shared/CmuxIrohTransport/Tests/CmuxIrohTransportTests/CmxIrohRelayCredentialCoordinatorTests.swift
…ortcuts # Conflicts: # Packages/macOS/CmuxCanvasUI/Sources/CmuxCanvasUI/CanvasModel.swift
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesPanel reordering
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 25✅ Passed checks (25 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR fixes an integer overflow in
Confidence Score: 5/5Safe to merge — the change is a minimal arithmetic reorder in one function, the clamped bounds are provably valid given existing guards, and a regression test already covers Int.min/Int.max inputs. The change replaces a single clamped-sum expression with a clamp-then-add idiom. The bounds ( No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile |
Follow-up to #8080, which was merged while its test-only overflow regression commit was still waiting for a macOS package-test runner.
This clamps the relative offset before adding it to the current Canvas tab index, so public callers can pass Int.min or Int.max without trapping. The regression test merged with #8080 now passes.
Validation:
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by cubic
Prevents overflow crashes when reordering Canvas tabs by bounding the requested move to the valid tab range. Supports issue 8041’s reorder shortcuts by making out-of-range moves safe no-ops.
CmuxCanvasUICanvasModel, compute allowable relative offset bounds from the current index and clamp the input offset before adding, so extreme values (e.g., Int.min/Int.max) don’t trap; the regression test now passes.Written for commit 417e55d. Summary will update on new commits.
Summary by CodeRabbit