Sync: an incoming edit is applied after the newer resolution row that superseded it, so one device keeps the older value

Author: johannesjoCreated Oct 1, 2026Updated Oct 1, 2026

Found while checking #10415 residual 1. Present on master (3d4c941); not caused by #10415. Related: #10408, #10379.

Reproduction

Fuzz trace from the pin "a tracked delta that loses to a field-patch row stays on its device only" (sync-fuzz-pinned-traces.json):

json
[{"d":"A","a":["editTaskNotes","t1","A4"]},{"d":"B","a":["track","t1",2000]},{"d":"A","s":1,"r":1},{"d":"C","a":["editTaskNotes","t1","C20"],"s":1}]
  1. A edits the notes.
  2. B tracks time and stays offline.
  3. A syncs.
  4. C edits the notes later and syncs. C wins the notes conflict, so C uploads a resolution row.
  5. Every device syncs to convergence.

Final state, probed with SyncFuzzHarness (master 3d4c941):

device notes timeSpent
A C20 0
B A4 0 (2000 with #10415, residual 1)
C C20 0

B keeps A's older notes. A restart of A does not change it.

Likely mechanism (from reading the code, not instrumented)

In B's batch, B's pending delta conflicts with C's row, and the row wins. A's notes op does not conflict, so it lands in nonConflictingOps.

ConflictResolutionService appends remote-win ops first (step 1) and nonConflictingOps after them (step 3). It then sorts the apply batch by durable seq. So A4, which C's row causally dominates, is applied after the row and overwrites C20 on B only.

The fix is probably to order the apply batch causally (or by vector clock) and not by resolution step, so that a remote op dominated by a remote winner is never applied after it. That is a sensitive area: seq order is what status-blind replay uses (see the comment above the allOpsToApply.sort).

Needs an E2E reproduction first.

Source: super-productivity/super-productivity