Page MenuHomePhorge

Add fallback endpoint for download
ClosedPublic

Authored by nannanko on May 26 2025, 10:14 PM.
Tags
None
Referenced Files
F7679132: D217.1756656123.diff
Sat, Aug 30, 9:02 AM
F7679046: D217.1756653483.diff
Sat, Aug 30, 8:18 AM
F7678735: D217.1756644162.diff
Sat, Aug 30, 5:42 AM
F7678471: D217.1756636618.diff
Sat, Aug 30, 3:36 AM
F7677810: D217.1756620715.diff
Fri, Aug 29, 11:11 PM
F7677473: D217.1756613229.diff
Fri, Aug 29, 9:07 PM
Subscribers
None

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 410
Build 803: GitLab CI for kazv
Build 802: 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 .

86–89
99–102

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

Add MatrixSdk::checkSpecVersionRange() and tests

src/matrix-sdk.hpp
113

Use exact wording to represent which of the limits are inclusive or exclusive. Based on your representation, it seems that your implementation is inclusive on both ends. In that case, say [minVer, maxVer].

This revision is now accepted and ready to land.Sat, Aug 23, 7:02 PM
This revision was automatically updated to reflect the committed changes.