Skip to content

fix: use thumbnail only if present#2395

Merged
td-famedly merged 1 commit into
mainfrom
krille/use-thumbnail-only-if-present
Jul 8, 2026
Merged

fix: use thumbnail only if present#2395
td-famedly merged 1 commit into
mainfrom
krille/use-thumbnail-only-if-present

Conversation

@krille-chan

Copy link
Copy Markdown
Contributor

No description provided.

@cursor

cursor Bot commented Jul 2, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Localized change to returned MatrixFile metadata in one code path; reduces mislabeled downloads without altering download/decrypt logic.

Overview
Fixes incorrect filename and MIME type on MatrixFile results from downloadAndDecryptAttachment when callers ask for a thumbnail but the event has none.

Introduces useThumbnail = getThumbnail && hasThumbnail so returned metadata only uses thumbnail naming (*.thumbnail.<ext>) and thumbnailMimetype when a thumbnail actually exists; otherwise the full attachment’s name and attachmentMimetype are used. This matches cases where download logic may still resolve the main attachment bytes when no thumbnail URL is present.

Reviewed by Cursor Bugbot for commit 7cdd7fb. Bugbot is set up for automated code reviews on this repo. Configure here.

@krille-chan krille-chan force-pushed the krille/use-thumbnail-only-if-present branch from 3731a0f to 0c844c6 Compare July 2, 2026 15:21
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.29%. Comparing base (c8f1062) to head (7cdd7fb).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2395   +/-   ##
=======================================
  Coverage   59.29%   59.29%           
=======================================
  Files         161      161           
  Lines       20303    20303           
=======================================
  Hits        12038    12038           
  Misses       8265     8265           
Files with missing lines Coverage Δ
lib/src/event.dart 87.90% <100.00%> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c8f1062...7cdd7fb. Read the comment docs.

@td-famedly td-famedly left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

@td-famedly td-famedly enabled auto-merge July 7, 2026 13:33
@krille-chan krille-chan force-pushed the krille/use-thumbnail-only-if-present branch from 0c844c6 to 7cdd7fb Compare July 8, 2026 06:41
@td-famedly td-famedly merged commit 2040db7 into main Jul 8, 2026
17 checks passed
@td-famedly td-famedly deleted the krille/use-thumbnail-only-if-present branch July 8, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants