Page MenuHomePhorge

Add fallback endpoint for download
Needs RevisionPublic

Authored by nannanko on May 26 2025, 10:14 PM.

Details

Summary

It checks whether the server supports the authenticated media endpoint. If it does, use it. Otherwise, use the old endpoint.

Type: add

Test Plan

Log in to a matrix.org account (or other homeservers that do not support old endpoints), check the download function work fine.

Verify unit tests pass.

Diff Detail

Repository
rK kazv
Branch
nannanko/mxc-v1
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 400
Build 783: GitLab CI for kazv
Build 782: arc lint + arc unit

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.May 26 2025, 10:21 PM
Harbormaster failed remote builds in B373: Diff 608!
nannanko edited the test plan for this revision. (Show Details)
Harbormaster returned this revision to the author for changes because remote builds failed.May 26 2025, 10:57 PM
Harbormaster failed remote builds in B374: Diff 609!
Harbormaster returned this revision to the author for changes because remote builds failed.Jun 7 2025, 6:07 PM
Harbormaster failed remote builds in B382: Diff 620!

Automatically select the download endpoint according to the server version

Harbormaster returned this revision to the author for changes because remote builds failed.Jun 14 2025, 6:54 PM
Harbormaster failed remote builds in B387: Diff 627!
nannanko planned changes to this revision.
tusooa requested changes to this revision.Sat, Aug 16, 5:49 AM
tusooa added inline comments.
src/contents/ui/FileHandler.qml
33–35

To be future-proof, this should check if it contains any version starting at v1.11, until the release of a future version that does not have the authenticated v1 endpoint.
By definition, if a server supports, say, v1.15, then it should also have the authenticated media v1 endpoint, even if it says it does not support v1.11 .

85–88
102–105

consider making it a property because it's reused

src/matrix-sdk.hpp
86–91

It's not clear what endpoint it is. The values are also confusing, because it makes people think v3 is newer than v1. I recommend naming them "UnauthenticatedMediaV3" and "AuthenticatedMediaV1." Also the enum name can be changed to "MediaDownloadEndpointVersion."

This revision now requires changes to proceed.Sat, Aug 16, 5:49 AM
tusooa edited the summary of this revision. (Show Details)

Improved naming, MatrixSdk::supportSpecVersion()

tusooa requested changes to this revision.Tue, Aug 19, 5:48 PM
tusooa added inline comments.
src/matrix-sdk.cpp
422

to transform this into an assertion on a range of two versions [a,b).

This revision now requires changes to proceed.Tue, Aug 19, 5:48 PM