Skip to content

Inbox: a Send survives another tab's save of the same answers - #4109

Merged
backnotprop merged 1 commit into
backnotprop:mainfrom
Raj1v:fix/inbox-send-same-answers
Nov 27, 2026
Merged

backnotprop merged 1 commit into
backnotprop:mainfrom
Raj1v:fix/inbox-send-same-answers

Conversation

@Raj1v

@Raj1v Raj1v commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #4107

A reply names each question it answers by the revision the window read, and the server sends what is saved at that revision. When another tab or device saves the same answer between the window's last save and its Send, the revision moves on and the reply comes back question_revision_conflict. The window does not retry, so the Send stops with "changed since you read it", even though the answer on screen is the answer the Inbox holds.

Changes:

  • sendOverSameAnswers (new, packages/inbox/data/actions/sendSameAnswers.ts): on question_revision_conflict it reads the thread again. If every question the reply sends is still picked with the answer the window shows, it sends once more at the Inbox's revisions. A different answer, a cleared pick, or a question sent from elsewhere keeps the refusal.
  • useSendReply takes an optional shown thread; the thread pane's Send passes it (one line in Thread.tsx).
  • Docs: docs/agent-guides/inbox-messages.md describes the rule.

The server is unchanged. A reply carries no answer, only a revision, so the store cannot tell a same-answer save from a different one; a stale revision still refuses for every other client.

Tests

  • packages/inbox/replySameAnswers.test.tsx (new, DOM, against a real Inbox): another client saves the same answer just before the reply goes, so the Send goes again once and writes one reply with no refusal shown. A second case saves a different answer: the refusal stands and nothing is sent. The first fails on main (one reply, refused) and passes here. bun run test:sandbox packages/inbox/replySameAnswers.test.tsx: 2 pass, 0 fail.
  • bun run test:sandbox tests/inbox-structure.test.ts scripts/dom-test-allowlist.test.ts packages/inbox/pickConflict.test.ts packages/inbox/data/actions/sendLanded.test.ts packages/inbox/skipNote.test.tsx packages/inbox/wordsOnlyTwoAsks.test.tsx packages/inbox/replyFeedback.test.tsx: 44 pass, 0 fail.
  • bun run typecheck: passes.

e2e:

A reply names each question by the revision the window read. When another
tab or device saved the same answer in between, the reply was refused with
question_revision_conflict and the Send stopped, although nothing on screen
had changed. The Send now reads the thread again and, when every question it
sends still holds the answer the window shows, sends once more at the Inbox's
revisions. A different answer, a cleared pick or a question sent elsewhere
keeps the refusal.
@backnotprop backnotprop added the ci:e2e Run the full browser suite (Inbox window e2e) on this PR label Nov 27, 2026
@backnotprop
backnotprop merged commit 243bfc8 into backnotprop:main Nov 27, 2026
57 checks passed
@backnotprop

Copy link
Copy Markdown
Owner

Merged, thank you. An independent read went through the retry specifically for the ways it could go wrong, and found none: it retries once, only on a revision conflict, only when a fresh read shows every named question still unsent and saying exactly what the window's copy says, and the retry carries no answer, only revisions, so it cannot send something different, send twice, or overwrite a newer answer from the other tab. It will ship in the next release. The same refusal still shows in Decision mode and the picks-only reply; we'll look at giving those the same treatment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:e2e Run the full browser suite (Inbox window e2e) on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inbox: a Send is refused when another tab saved the same answers in between

2 participants