Skip to content

fix(chat): skip the transcript fetch for a DM that doesn't exist yet - #1591

Merged
bmc08gt merged 1 commit into
code/cashfrom
fix/chat-open-missing-dm
Sep 28, 2026
Merged

bmc08gt merged 1 commit into
code/cashfrom
fix/chat-open-missing-dm

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

Opening a DM with someone you've never chatted with reports two errors to Bugsnag: GetChatError$NotFound and then GetMessagesError$Denied. On 2026.9.2 (4581) that's 143 and 144 events, from the same 49 users, first seen a second apart. Nothing breaks for the user; each open just costs two reports and a GetMessages call that can't succeed.

A ChatIdentifier.ByUser open derives the DM's id before the chat exists. openTranscript (added in #1498) asks hydrateChat for the chat, and GetChat answers NOT_FOUND. hydrateChat returned null for that and for "already stored" alike, so the screen went on to load messages, and the server answers GetMessages on a chat it has never heard of with DENIED. The volume comes from scanning a tip card, which opens the chat on the scanned user from 2026.9.2 onward (#1461).

hydrateChat now returns a ChatHydration: Stored, Fetched, Absent (NOT_FOUND) or Unavailable (any other failure). openTranscript skips the load for Absent only. A failed lookup still loads, since it says nothing about the chat, and the first tip already loads the new chat through TipPaymentDelegate.

GetChatError.NotFound is now an UnreportedError, as #1430 did for GetMessagesError.NotFound. Every getChat caller handles it: this path, the roster refetch, getOtherMember, and the group link lookup, which treats it as a deleted group. GetMessagesError.Denied stays reported, because for a balance-gated group it can be a real fault.

Bugsnag: GetMessagesError$Denied, GetChatError$NotFound

Opening a DM on its derived id before anyone has written in it, as
scanning a tip card now does, made GetChat answer NOT_FOUND. hydrateChat
returned null for that and for a stored chat alike, so openTranscript
went on to call GetMessages, which the server answers DENIED. Both were
reported to Bugsnag on every such open.

hydrateChat now returns a ChatHydration that keeps Absent apart from
Stored and Unavailable, and openTranscript skips the load for Absent.
GetChatError.NotFound becomes an UnreportedError; every getChat caller
already handles it.
@bmc08gt bmc08gt self-assigned this Sep 28, 2026
@github-actions github-actions Bot added type: fix Bug fix area: network gRPC, connectivity, API, exchange rates and removed type: fix Bug fix labels Sep 28, 2026
@bmc08gt
bmc08gt merged commit 4c7b48f into code/cash Sep 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: network gRPC, connectivity, API, exchange rates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant