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

send queue: implement full unwedging of media uploads #4258

Merged
merged 3 commits into from
Nov 13, 2024

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented Nov 13, 2024

A media upload can fail forever (i.e. get wedged) at step 1 (thumbnail upload failed) or 2 (media upload failed), for instance because the media's too large and the server's refusing it. This implements unwedging for such cases, with a naive yet effective solution: since only at most one QueuedRequest with one of the three transaction IDs used during a upload may be active, we can unwedge all 3 in the database; at most one will have an effect, and the other two will be spurious 🤓

Part of #4201

@bnjbvr bnjbvr requested a review from a team as a code owner November 13, 2024 11:34
@bnjbvr bnjbvr requested review from Hywan and removed request for a team November 13, 2024 11:34
Copy link

codecov bot commented Nov 13, 2024

Codecov Report

Attention: Patch coverage is 68.18182% with 7 lines in your changes missing coverage. Please review.

Project coverage is 84.92%. Comparing base (d446eb9) to head (3468150).
Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
crates/matrix-sdk/src/send_queue.rs 50.00% 7 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4258   +/-   ##
=======================================
  Coverage   84.91%   84.92%           
=======================================
  Files         274      274           
  Lines       29768    29778   +10     
=======================================
+ Hits        25278    25288   +10     
  Misses       4490     4490           

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

Copy link
Member

@Hywan Hywan left a comment

Choose a reason for hiding this comment

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

From my point of view, it looks correct, thanks!

assert!(local_echoes.is_empty());

// Create the media to send (no thumbnails).
let filename = "rickroll.gif";
Copy link
Member

Choose a reason for hiding this comment

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

🙄

// Create the media to send (no thumbnails).
let filename = "rickroll.gif";
let content_type = mime::IMAGE_JPEG;
let data = b"Never gonna give you up".to_vec();
Copy link
Member

Choose a reason for hiding this comment

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

🤦

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm never gonna let you down Hywan!

@bnjbvr bnjbvr merged commit 99b9c50 into main Nov 13, 2024
40 checks passed
@bnjbvr bnjbvr deleted the bnjbvr/send-queue-unwedge branch November 13, 2024 13:32
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