Repository navigation
Description
Context
Part of #3150. Found while fixing #3733.
Since #3733, an acceptance that releases an outgoing snapshot and keeps the draft moves the draft to a new revision (accept, packages/ui-server/src/drafts/store.ts:806-876). A tab or device that read the draft before the acceptance now gets 409 DRAFT_CONFLICT with current on its next save, instead of silently recreating the sent snapshot.
The client treats that 409 like any other device's edit. failed in packages/ui-react/src/lib/draft-client.ts:140-146 saves again over current only when current.revision is not newer than the revision it knows. Otherwise it calls conflictWith, which shows the conflict choice. When the only difference between current and this tab's copy of the host draft is that an accepted snapshot left the list, the user is asked to resolve a conflict nobody made. The text, the composer files and every other snapshot are the same.
This was read from the source and has not been seen in a browser. The case needs two tabs or devices on one chat's draft: one sends a snapshot, and the other saved a newer revision before the acceptance.
Scope
- When a
409 DRAFT_CONFLICT'scurrentdiffers from this tab's host copy only by snapshots thatcurrentno longer lists, and those snapshots aredispatchedhere, the client treats them as released by acceptance (asreconcileSnapshotsdoes,draft-client.ts:312-335), adoptscurrent.revisionand saves again without showing the conflict choice. - Any other difference still shows the conflict choice.
Out of scope
- The host rule from ui-server: a stale draft save recreates an accepted outgoing snapshot #3733.
- Conflicts from other causes.
Acceptance criteria
- A ui-react test, failing first on the current tree, where the host answers a save with
409 DRAFT_CONFLICTwhosecurrentdrops only this tab'sdispatchedsnapshot at a newer revision. The tab saves again over that revision, the snapshot leaves its list, and no conflict choice is shown. - A sibling test where
currentalso changes the text still shows the conflict choice.
Verification
bun run test for the ui-react draft tests, plus bun run check:pr --base origin/main.
Contract impact
None. This is client behaviour inside the existing If-Match contract.
2026-11-16 triage at main 3b104890f8: Verified failed and reconcileSnapshots in the cited draft client. The selected behavior is limited to an exact host-copy comparison with only this tab’s dispatched snapshots removed; text, file, other-snapshot or unresolved identity differences still conflict. Add zero-send/once-only and genuine-conflict controls to the focused draft-client proof; no picker/layout decision or wire change is needed. The source-qualified client repair is ready, preserves p3 and its native parent #3150, and does not claim a natural browser reproduction.
Activity