Repository navigation
fix(chat): redraw a typing avatar when the typist's profile resolves - #1569
Merged
Merged
Conversation
A group typist whose profile hadn't loaded yet kept drawing the gradient fallback after the profile arrived. ChatViewModel emits the typist with a null profile first and again once the profile resolves, under the same key. AvatarStack only copied new values into its entries from the effect keyed on the set of keys, so the second emission never reached the avatar. A second effect keyed on the typist list now refreshes each entry that is still shown. The key-driven effect keeps its key, since restarting it would cancel the coroutine that removes a leaving avatar.
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 typing avatars sometimes showed only the gradient fallback for members who have a profile picture.
It happens when someone starts typing before their profile is loaded.
ChatViewModelemits the typist withprofile = null, requests the profile, and emits the typist again once it arrives, under the same key.AvatarStackinTypingIndicatoronly wrote new values into its entries fromLaunchedEffect(shownKeys), and the keys hadn't changed, so the entry kept the null-profile typist.The fix adds a
LaunchedEffect(shown)that refreshes each entry still on screen. The key-driven effect keeps its key: restarting it on every update would cancel the coroutine that animates out and removes a leaving avatar.TypingIndicatorTestswaps a typist for a changed copy under the same key and checks the avatar redraws. It fails without the fix.