Skip to content

ui-react: a conflict caused only by an accepted snapshot's release asks the user to resolve it #4061

Open

Description

@schlessera

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's current differs from this tab's host copy only by snapshots that current no longer lists, and those snapshots are dispatched here, the client treats them as released by acceptance (as reconcileSnapshots does, draft-client.ts:312-335), adopts current.revision and saves again without showing the conflict choice.
  • Any other difference still shows the conflict choice.

Out of scope

Acceptance criteria

  • A ui-react test, failing first on the current tree, where the host answers a save with 409 DRAFT_CONFLICT whose current drops only this tab's dispatched snapshot 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 current also 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

  1. added
    type: fix
    area: ui-react
    priority: p3
    on Nov 15, 2026
  2. added
    agent-ready
    on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyarea: ui-reactpriority: p3type: fix

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions