Skip to content

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

Done

Description

@Raj1v

What happens
I answer a thread's questions in one tab while the same thread is open in another tab (or on my phone), and both save the same answers. When I press Send, the reply comes back question_revision_conflict and the window stops with "changed since you read it". The answers on screen are exactly the answers the Inbox holds, but nothing is sent and the window does not try again.

Cause
A reply names each question it answers by the revision the window read, and the store refuses whenever that revision is no longer the saved one (record.revision !== entry.revision in packages/shared/inbox/store.ts). Another client's save of the same answer moves the revision on. The reply carries no answer, only the revision, so the store cannot tell a save of the same answer from a different one. The window's Send (sendReply.mutateAsync in Thread.tsx) sends once and shows the refusal.

Fix
On question_revision_conflict, the window reads the thread again. If every question it sends is still picked with the answer it shows, it sends once more at the Inbox's revisions; otherwise the refusal stands. The server stays as it is, so every other client keeps today's behaviour.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions