Repository navigation
fix(chat): keep group members a FullRefresh leaves out - #1587
Merged
Merged
Conversation
A FullRefresh replaced the chat's cached members with the metadata's member list. For a group that list is only a page of the roster, so the refresh deleted every other member the device held from roster changes, message loads and feed pages. When one of them sent the last message, the Chats list preview lost the "Name: " prefix until something cached them again. Groups now merge on FullRefresh, as RosterStateHolder.refetch already does, and departures come through MemberLeft. DMs still replace. A member row with no profile row maps to UserProfile.Empty, whose name is "", so the preview read ": text". formatPreview now treats a blank name as missing, as iOS does.
The profile proto allows an empty display_name, and the app stores it as-is, so a group member with no name drew an empty textSmall line above their run. The avatar still marks the run.
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.
Group rows in the Chats list switched between "Name: text" and bare "text".
formatPreviewonly prefixes when the sender is in the chat's cached members, and two things broke that.FullRefresh deleted group members.
EventStreamDelegatehandledMetadataUpdate.FullRefreshwithreplaceMembers, which deletes every cached member not inmetadata.members. For a group that list is a page of the roster (chat/v1/model.proto: "For large group chats, this is a subset of all members"), so each refresh dropped members the device had cached from roster changes, message loads and feed pages. If one of them sent the last message, the row lost the name until something cached them again. Groups nowupserton FullRefresh, the same asRosterStateHolder.refetch, and departures come throughRosterChange.MemberLeft. DMs still usereplaceMembers.replaceMemberson this path came in with #1365.An empty name read as ": text".
ChatEntityMapper.toMembermaps a member with no profile row toUserProfile.Empty, whosedisplayNameis"", andformatPreviewtreated that as a name. Group cash had the same problem. A blank name now counts as missing, matching iOS'sConversationController.groupSenderName.The transcript drew a blank name line. The profile proto allows an empty
display_name(min_len: 0), and the app stores it unchanged, so a group member with no name got an empty line above their run of messages.MessageRownow skips the name line when it is blank; the avatar is still drawn.Tests:
FullRefreshMembersTeststreams a FullRefresh throughEventStreamDelegateagainst the real member table. A group with A, B and C cached keeps B and C (and C's name) after a refresh listing only A; a DM refresh still replaces. The group case fails without the fix.ChatSummaryPreviewTestcovers a blank-named sender for text and cash; both fail without the fix.GroupTranscriptScreenshotTest.omitsNameLineForBlankDisplayNamerenders a run from a nameless sender and checks no blank text node is drawn; it fails without the fix.A sender who was never in any page the device received still previews as bare text, as on iOS. Changing that needs a product or backend decision.