-
Notifications
You must be signed in to change notification settings - Fork 252
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
Conversation
So it can be reused in more contexts than just the sending of an event, but also for uploads.
Codecov ReportAttention: Patch coverage is
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. |
There was a problem hiding this 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"; |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦
There was a problem hiding this comment.
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!
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