Fix critical sync, git undo, and Work draft lane bugs#342
Closed
cursor[bot] wants to merge 1 commit into
Closed
Conversation
- Skip incoming CRDT changes for dropped unified_memories tables so mixed-version sync batches are not rejected after Memory Wipe (#329). - Exclude git_checkout_branch from undo head changes; reset --hard alone corrupts branch refs after History "Create branch here". - Key Work draft composer text by draft:\${laneId} so lane switches restore per-lane drafts instead of leaking text across lanes. Co-authored-by: Arul Sharma <arul28@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This was referenced May 23, 2026
Owner
|
Consolidated into #356. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Cron critical-bug audit found three high-severity correctness issues in recent commits (#329 Memory Wipe, #332 History). This PR applies minimal fixes with tests.
Bugs fixed
1. Sync batch failure after Memory Wipe (data stall)
Impact: After desktop upgrades drop
unified_memories, any CRDT batch from an older peer (e.g. iOS) that still includes memory changes causedapplyChangesto throw on missing table schema, rolling back the entire batch — lanes/sessions/PRs in the same batch never applied.Root cause:
normalizeIncomingCrsqlChangerequires a local table with a single PK; dropped tables have notable_info.Fix: Skip incoming changes for dropped legacy memory tables and any table that no longer exists locally.
2. Git undo corrupts branch after checkout (History)
Impact: History Create branch here → Undo last head change runs
git reset --hardon the new branch ref without restoringlanes.branch_reffromswitchBranch, moving the wrong branch pointer.Root cause:
git_checkout_branchis recorded as a head-changing op but undo only reverses commit SHA, not branch metadata.Fix: Exclude
git_checkout_branchfrom undoable head changes (undo skips to the prior reset/cherry-pick/etc.).3. Work draft sent on wrong lane
Impact: Composer draft text was keyed only by
selectedSessionId(alwaysnullin draft mode), so switching lanes in the empty-state picker kept the previous lane's message; Send created a session on the wrong lane.Fix: Store drafts under
draft:${laneId}(same key as companion UI state) and restore on lane change.Validation
npx vitest run src/main/services/git/gitOperationsService.test.ts -t "undo|redo|checkout"— passNot in scope