Skip to content

Fix History destructive git on wrong lane from commit deeplinks - #348

Closed
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-detection-6d08
Closed

Fix History destructive git on wrong lane from commit deeplinks#348
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-detection-6d08

Conversation

@cursor

@cursorcursorBot commented May 23, 2026

Copy link
Copy Markdown
Contributor

Bug and impact

Opening History with commitSha in the URL but no valid laneId (shared commit link, stale lane id, etc.) auto-selected the global lane or the first lane. getCommit resolves any commit in the shared object database, so hard reset / cherry-pick / revert / branch creation could run against the wrong worktree — branch pointer corruption and discarded uncommitted work.

Root cause

  • HistoryPage URL hydration fell back focusLaneId whenever laneId was missing.
  • Destructive actions only checked hasWorktree, not whether the commit belongs to the focused lane's history.

Fix

  • Skip lane auto-fallback when the URL targets a commit without a known laneId.
  • Track commitOnLaneHistory (listed in lane's recent commits vs cross-repo getCommit only).
  • Disable lane git mutations until the user selects the lane that owns the commit.

Validation

  • npm --prefix apps/desktop run test -- --run src/renderer/components/history/historyGitActions.test.ts (12 passed)

Related open PRs (not duplicated)

Open in WebView Automation

History commit deeplinks without laneId used to fall back to the global
selected lane or the first lane. getCommit resolves any object in the
shared repo, so hard reset/cherry-pick/revert could mutate the wrong
worktree.
- Skip lane auto-fallback when URL has commitSha without a valid laneId
- Track whether the commit came from lane history vs cross-repo lookup
- Disable lane git mutations until the user selects the owning lane
Co-authored-by: Arul Sharma <arul28@users.noreply.github.com>
@vercel

vercelBot commented May 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
adeIgnoredIgnoredMay 23, 2026 4:14am

@arul28

Copy link
Copy Markdown
Owner

Consolidated into #356.

@arul28arul28 closed this May 25, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@arul28@cursoragent