Repository navigation
fix(chat): stop a group re-rendering as a DM with one of its members - #1531
Merged
Merged
Conversation
When a group's roster changed, the chat screen redrew for about half a second as a tip DM with the first other member: their name in the title bar, no sender avatars, and the "$" composer, then "Send a Tip", before flipping back. The tip counterparty collector took the first non-self member of any chat, and OnTipUserResolved replaced the Group subject with it. observeMetadata combines the members table too, so one roster change emitted on both flows and OnGroupResolved only put the group back afterwards. Opening a group by chat id also dispatched OnTipDmDetected, since a group has no device contact either. Both reducers now keep a resolved group, the collector skips chats whose metadata says GROUP, and the open path checks the cached metadata before marking a tip DM.
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.
When a group's roster changes, the chat screen redraws for about half a second as a tip DM with the first other member. The title bar shows that member, sender avatars disappear, and the composer goes
$ + Message→Send a Tip→ hidden before the group comes back.Two paths in
ChatViewModelread "no device contact" as "tip DM", and a group has no device contact either:OnTipUserResolvedreducer replaced theGroupsubject with it.observeMetadatacombines the members table, so a single roster change emits on both flows, andOnGroupResolvedonly restores the group after the DM frame has drawn.OnTipDmDetected, which setchatType = TIP_DMon a group.Changes:
OnTipUserResolvedandOnTipDmDetectedleave a resolvedChatSubject.Groupalone.GROUP.ByChatIdopen path reads the cached metadata before dispatchingOnTipDmDetected.A group opened before any metadata is cached still has no type to check against, so the collector can resolve a member until
OnGroupResolvedarrives. The reducer guard covers every emission after that.ChatViewModelStateTestpins both reducer guards.