Skip to content

Conversation

@zecakeh
Copy link
Collaborator

@zecakeh zecakeh commented Aug 12, 2025

This includes 3 small commits:

  1. Use the new built-in support for (un)stable feature flags in Ruma to decide on whether we will use the authenticated media endpoints, instead of having custom code in the SDK.
  2. Since refactor: Add read_timeout for HTTP requests, make timeout optional #5437, the request timeout was ignored in media requests, however that didn't apply to unauthenticated media endpoints because they didn't use the modified request config. This fixes it.
  3. fix(sdk): check max_upload_size before attempting to upload any media #5119 added a mandatory check when uploading files, using the allowed upload size advertised by the server at the media config endpoint. However that check only supports the authenticated media config endpoint, so users on servers that don't support authenticated media cannot send media anymore. We got a bug report because of that in Fractal, from a user using a private homeserver instance that doesn't support authenticated media. This adds support for the unauthenticated media config endpoint too.

…ia endpoints too

There is no reason to treat them differently.

Signed-off-by: Kévin Commaille <[email protected]>
@zecakeh zecakeh requested a review from a team as a code owner August 12, 2025 09:57
@zecakeh zecakeh requested review from stefanceriu and removed request for a team August 12, 2025 09:57
@codspeed-hq
Copy link

codspeed-hq bot commented Aug 12, 2025

CodSpeed Performance Report

Merging #5516 will not alter performance

Comparing zecakeh:media-fixes (1e85306) with main (e2f0b4f)

Summary

✅ 31 untouched benchmarks

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.

Very nice, thank you Kevin! 👍

Signed-off-by: Kévin Commaille <[email protected]>
@codecov
Copy link

codecov bot commented Aug 12, 2025

Codecov Report

❌ Patch coverage is 89.55224% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.58%. Comparing base (6c944a9) to head (1e85306).
⚠️ Report is 11 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/matrix-sdk/src/client/mod.rs 93.02% 0 Missing and 3 partials ⚠️
crates/matrix-sdk/src/media.rs 50.00% 1 Missing and 2 partials ⚠️
crates/matrix-sdk/src/config/request.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5516      +/-   ##
==========================================
+ Coverage   88.57%   88.58%   +0.01%     
==========================================
  Files         339      339              
  Lines       93627    93660      +33     
  Branches    93627    93660      +33     
==========================================
+ Hits        82927    82968      +41     
+ Misses       6565     6559       -6     
+ Partials     4135     4133       -2     

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

@zecakeh
Copy link
Collaborator Author

zecakeh commented Aug 12, 2025

All right, I fixed the CI.

@stefanceriu
Copy link
Member

Beautiful, thank you!

@stefanceriu stefanceriu merged commit 1eb8f6a into matrix-org:main Aug 12, 2025
50 checks passed
@zecakeh zecakeh deleted the media-fixes branch August 12, 2025 14:26
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