Repository navigation
fix(chat): load a bubble-sized rendition for chat photos - #1758
Merged
Merged
Conversation
A photo bubble downloaded the full-size original, 3.5-5.5 MB for the recent photos in one group, though the server also derives 800 and 1600px renditions. On a slow link the BlurHash stayed up for the whole download, and leaving the chat cancelled it. The bubble now loads the smallest derived rendition that fills its width and falls back to the original when there is none (sealed photos, or ones still processing). The viewer and share still use the original, with the bubble's cached image as the placeholder. Also logs when a photo download starts, finishes or is cancelled, and when a chat switches to previewing, which blurs every photo in 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.
A user reported photos in a group chat staying on the BlurHash. The bubble was downloading the full-size original for every photo: the group's last three were 3.5, 3.8 and 5.5 MB, while the server also sends 800 and 1600px renditions of each. On a slow link the BlurHash stays up for the whole download, and leaving the chat cancels it, so the next visit starts over.
MediaMessageBubbleloadsrenditionForSize(bubble width), falling back to the original when the server derived nothing. Sealed photos and photos still being sent only have the original.ChatPhotoSourcecarries the original separately asfullModel. The viewer and share use it, with the bubble's cached rendition as the placeholder while it loads.ChatPhotoFetcherlogs when a download starts (role and size), finishes, or is cancelled. Disk-cache hits stay quiet.ChatViewModellogs when the viewer starts or stops previewing a group, since that blurs every photo with nothing on screen saying why.On a Seeker, the Pokemon TCG group's bubbles downloaded the DISPLAY rendition (110–180 KB, about 0.5 s each), and opening one full screen downloaded the 750 KB original.