You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pub struct MediaCache {
/// The actual cached data.
cache: BTreeMap<OwnedMxcUri, MediaCacheEntryRef>,
/// The default format to use when fetching media.
default_format: MediaFormatConst,
/// A channel to send updates to a particular timeline when a media request has completed.
timeline_update_sender: Option<crossbeam_channel::Sender<TimelineUpdate>>,
}
For images in the matrix server, firstly, they are divided into two segments: the original and the thumbnail.
Then, separately, there are several versions with different resolutions under the two segments: 100x100, 200x200 ......, that is, there are many combinations.
Currently, Robrix is using a combination in the timeline: thumbnail & 400x400
But, there is a rare condition: an image is unclear enough, it would not possess a thumbnail, Ok ,we show the combination in the timeline: original & 400x400.
When user click it (the rare condition mentioned above), try_get_media_or_fetch wont fetch the combination: original & File, instead, it would find the image data (original & 400x400) via same key OwnedMxcUri in local disk, and show it, this is not what we want.
This refactoring is aimed to solve this rare problem while improving its robustness.
I shall advance #341 after this issue is fixed.
The text was updated successfully, but these errors were encountered:
For images in the matrix server, firstly, they are divided into two segments: the
original
and thethumbnail
.Then, separately, there are several versions with different resolutions under the two segments: 100x100, 200x200 ......, that is, there are many combinations.
Currently, Robrix is using a combination in the timeline:
thumbnail & 400x400
But, there is a rare condition: an image is unclear enough, it would not possess a
thumbnail
, Ok ,we show the combination in the timeline:original & 400x400
.When user click it (the rare condition mentioned above),
try_get_media_or_fetch
wont fetch the combination: original & File, instead, it would find the image data (original & 400x400) via same key OwnedMxcUri in local disk, and show it, this is not what we want.This refactoring is aimed to solve this rare problem while improving its robustness.
I shall advance #341 after this issue is fixed.
The text was updated successfully, but these errors were encountered: