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

feat(media): support async upload #4165

Merged
merged 2 commits into from
Oct 24, 2024
Merged

feat(media): support async upload #4165

merged 2 commits into from
Oct 24, 2024

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented Oct 23, 2024

This adds support for preallocated a MXC ID and using it to upload content later.

Part of #1732.

@bnjbvr bnjbvr requested a review from a team as a code owner October 23, 2024 15:07
@bnjbvr bnjbvr requested review from andybalaam and removed request for a team October 23, 2024 15:07
@bnjbvr bnjbvr force-pushed the bnjbvr/async-media branch from 553c2e0 to c5f8e17 Compare October 23, 2024 15:14
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

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

Project coverage is 84.83%. Comparing base (31e9600) to head (0ec1d24).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
crates/matrix-sdk/src/media.rs 66.66% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4165      +/-   ##
==========================================
- Coverage   84.85%   84.83%   -0.02%     
==========================================
  Files         269      269              
  Lines       28916    28937      +21     
==========================================
+ Hits        24536    24549      +13     
- Misses       4380     4388       +8     

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

Copy link
Contributor

@poljar poljar left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for adding a doc example, small nit about the changelog. First word should be capitalized if I look at the other changelog entries.

// Unfortunately, the spec says a server will return 404 for either an expired MXC
// ID or a non-existing MXC ID. Do a best-effort guess to recognize an expired MXC
// ID based on the error string, which will work with Synapse (as of 2024-10-23).
Some(ErrorKind::Unknown) if err.to_string().contains("expired") => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Ouch.

@andybalaam andybalaam removed their request for review October 24, 2024 08:00
Changelog: Support for preallocated media content URI has been added in
`Media::create_content_uri()`, and uploading the content for such a
preallocated URI is possible with `Media::upload_preallocated()`.
@bnjbvr bnjbvr force-pushed the bnjbvr/async-media branch from c5f8e17 to 0ec1d24 Compare October 24, 2024 14:33
@bnjbvr bnjbvr enabled auto-merge (rebase) October 24, 2024 14:37
@bnjbvr bnjbvr merged commit f8c23d8 into main Oct 24, 2024
40 checks passed
@bnjbvr bnjbvr deleted the bnjbvr/async-media branch October 24, 2024 14:49
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