diff --git a/crates/matrix-sdk-ui/tests/integration/timeline/media.rs b/crates/matrix-sdk-ui/tests/integration/timeline/media.rs index d35cbbcfe..2987ce12c 100644 --- a/crates/matrix-sdk-ui/tests/integration/timeline/media.rs +++ b/crates/matrix-sdk-ui/tests/integration/timeline/media.rs @@ -574,7 +574,7 @@ async fn test_send_media_with_thumbnail() -> TestResult { .media() .get_media_content( &MediaRequestParameters { - source: content.source.clone(), + source: MediaSource::Plain(thumbnail_uri.clone()), format: MediaFormat::Thumbnail(MediaThumbnailSettings::new( uint!(37), uint!(13), diff --git a/crates/matrix-sdk/src/send_queue/upload.rs b/crates/matrix-sdk/src/send_queue/upload.rs index 5be0fb626..e45bacc1e 100644 --- a/crates/matrix-sdk/src/send_queue/upload.rs +++ b/crates/matrix-sdk/src/send_queue/upload.rs @@ -978,11 +978,12 @@ async fn update_media_cache_keys_after_upload( .await { Ok(Some(thumbnail_content)) => { - // Cache this as a thumbnail for the original source, in the media store. + // Also cache this as a thumbnail for the thumbnail, in the media store; the + // ElementX apps expect that specific format for thumbnails. media_store .add_media_content( &MediaRequestParameters { - source: sent_media.file.clone(), + source: remote_thumbnail_source.clone(), format: MediaFormat::Thumbnail(MediaThumbnailSettings::new( width, height, )), diff --git a/crates/matrix-sdk/tests/integration/send_queue.rs b/crates/matrix-sdk/tests/integration/send_queue.rs index af9a91ea6..77829bf15 100644 --- a/crates/matrix-sdk/tests/integration/send_queue.rs +++ b/crates/matrix-sdk/tests/integration/send_queue.rs @@ -2148,13 +2148,13 @@ async fn test_media_uploads() { .expect("media should be found"); assert_eq!(thumbnail_media_as_file, b"thumbnail"); - // The thumbnail can be retrieved as a thumbnail of the original media, using + // The thumbnail can be retrieved as a thumbnail of itself, using // the sent media MXC URI: let thumbnail_media_as_thumbnail = client .media() .get_media_content( &MediaRequestParameters { - source: new_content.source, + source: new_thumbnail_source.clone(), format: MediaFormat::Thumbnail(MediaThumbnailSettings::new(uint!(37), uint!(13))), }, true,