Automatically reconcile concurrent cross-device Draft saves #857

Closed
opened 2026-08-14 23:22:41 +00:00 by timmy · 0 comments
Owner

Problem

Concurrent Draft saves from phone and desktop race on the revision guard. The loser receives HTTP 409, remains local-only, and the UI says “Sync again” without providing a control. No later sync occurs unless another mutation or reconnect event happens.

Evidence on current main: frontend/unfiled-draft-sync.js treats 409 as terminal at the PUT boundary; the mounted controller only retries on startup or online. This is distinct from #851 (initial cross-device sync) and #853 (preserving divergent same-ID edits).

Vertical slice

Make Draft synchronization automatically rebase and retry a bounded number of times after revision races, while retaining every local Draft and preserving existing conflict-copy semantics. Expose an explicit retry path after exhaustion.

Acceptance tests

  • Two devices that read the same revision and save distinct Drafts converge without another user mutation.
  • A 409 snapshot is rebased and retried with a strict bound; no unbounded request loop.
  • Same-ID divergent edits still preserve both versions as a conflict copy.
  • Exhaustion keeps local Drafts and exposes a retryable state/action.
  • Overlapping signals remain single-flight and account scoped.
  • Focused tests and the full suite pass.
## Problem Concurrent Draft saves from phone and desktop race on the revision guard. The loser receives HTTP 409, remains local-only, and the UI says “Sync again” without providing a control. No later sync occurs unless another mutation or reconnect event happens. Evidence on current main: `frontend/unfiled-draft-sync.js` treats 409 as terminal at the PUT boundary; the mounted controller only retries on startup or `online`. This is distinct from #851 (initial cross-device sync) and #853 (preserving divergent same-ID edits). ## Vertical slice Make Draft synchronization automatically rebase and retry a bounded number of times after revision races, while retaining every local Draft and preserving existing conflict-copy semantics. Expose an explicit retry path after exhaustion. ## Acceptance tests - Two devices that read the same revision and save distinct Drafts converge without another user mutation. - A 409 snapshot is rebased and retried with a strict bound; no unbounded request loop. - Same-ID divergent edits still preserve both versions as a conflict copy. - Exhaustion keeps local Drafts and exposes a retryable state/action. - Overlapping signals remain single-flight and account scoped. - Focused tests and the full suite pass.
timmy self-assigned this 2026-08-14 23:22:41 +00:00
timmy closed this issue 2026-08-14 23:31:12 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: stackchain/stackchain-dashboard#857
No description provided.