Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(send queue): cached thumbnails of unknown dimensions are removed after upload #4260

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented Nov 13, 2024

When we don't know the dimensions of a thumbnail, we still need some dimensions to cache it locally in the cache store, because it's required to send the thumbnail with the send queue. As a result, we default to using 0 for the unknown dimensions.

However, as soon as the thumbnail and file have been uploaded, there's no need to keep the 0-sized thumbnail in the cache; it's more likely the callers will try to retrieve it with actual, realistic sizes later. As a result, remove those locally-cached thumbnails from the cache store after a successful upload, if one of their dimensions was unknown.

Part of #4201

Copy link

codecov bot commented Nov 13, 2024

Codecov Report

Attention: Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.

Project coverage is 84.99%. Comparing base (c02d8ce) to head (4bd8818).
Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
crates/matrix-sdk/src/send_queue/upload.rs 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4260      +/-   ##
==========================================
+ Coverage   84.96%   84.99%   +0.02%     
==========================================
  Files         274      274              
  Lines       29851    29857       +6     
==========================================
+ Hits        25362    25376      +14     
+ Misses       4489     4481       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bnjbvr bnjbvr force-pushed the bnjbvr/send-queue-no-caching-zero-sized-thumbnail branch from ab0c6bf to 4bd8818 Compare November 14, 2024 11:02
@bnjbvr bnjbvr marked this pull request as ready for review November 14, 2024 11:02
@bnjbvr bnjbvr requested a review from a team as a code owner November 14, 2024 11:02
@bnjbvr bnjbvr requested review from stefanceriu and removed request for a team November 14, 2024 11:02
Copy link
Member

@stefanceriu stefanceriu left a comment

Choose a reason for hiding this comment

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

Makes sense to me! 👌

@bnjbvr bnjbvr closed this Nov 14, 2024
@bnjbvr bnjbvr reopened this Nov 14, 2024
@bnjbvr bnjbvr enabled auto-merge (rebase) November 14, 2024 15:08
@bnjbvr bnjbvr merged commit 02c7c2c into main Nov 14, 2024
79 of 80 checks passed
@bnjbvr bnjbvr deleted the bnjbvr/send-queue-no-caching-zero-sized-thumbnail branch November 14, 2024 15:22
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