-
Notifications
You must be signed in to change notification settings - Fork 268
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
refactor(ffi): clean up functions to send medias #4482
Conversation
Note: `Box<dyn ProgressWatcher>` couldn't be put in a `Record`, so doesn't belong in `UploadParameters` as a result.
…uish early from late errors Some errors can be handled immediately and don't need a request to be spawned, e.g. invalid mimetype and so on. The returned task handle still deals about "late" errors about the upload failing (for sync uploads) or the send queue failing to push the media upload (for async uploads).
This is a breaking change because uniffi may use foreign-language named parameters based on the Rust parameter name.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4482 +/- ##
==========================================
- Coverage 85.12% 85.10% -0.03%
==========================================
Files 283 283
Lines 31768 31768
==========================================
- Hits 27043 27035 -8
- Misses 4725 4733 +8 ☔ 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.
Nice refactoring. Thanks!
Ok(None) | ||
} | ||
} | ||
} | ||
|
||
#[derive(uniffi::Record)] | ||
pub struct UploadParameters { |
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.
And here is the approval.
Number of parameters and code duplication has gone a bit too wild lately.