Repository navigation
fix(chat): skip the transcript fetch for a DM that doesn't exist yet - #1591
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opening a DM with someone you've never chatted with reports two errors to Bugsnag:
GetChatError$NotFoundand thenGetMessagesError$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.ByUseropen derives the DM's id before the chat exists.openTranscript(added in #1498) askshydrateChatfor the chat, andGetChatanswers NOT_FOUND.hydrateChatreturnednullfor 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).hydrateChatnow returns aChatHydration:Stored,Fetched,Absent(NOT_FOUND) orUnavailable(any other failure).openTranscriptskips the load forAbsentonly. A failed lookup still loads, since it says nothing about the chat, and the first tip already loads the new chat throughTipPaymentDelegate.GetChatError.NotFoundis now anUnreportedError, as #1430 did forGetMessagesError.NotFound. EverygetChatcaller handles it: this path, the roster refetch,getOtherMember, and the group link lookup, which treats it as a deleted group.GetMessagesError.Deniedstays reported, because for a balance-gated group it can be a real fault.Bugsnag: GetMessagesError$Denied, GetChatError$NotFound