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: alt way for auth media (BREAKING) #1903

Closed
wants to merge 1 commit into from
Closed

Conversation

td-famedly
Copy link
Member

@td-famedly td-famedly commented Aug 16, 2024

This removes the version checks, and expects clients to manually return both endpoints using the useAuthentication flag

Breaking change but tries both new and old endpoints. Would require clients to implement a retry mech for their media if they fail.

Particularly useful when servers are misconfigured so they return on the old endpoints but not on the new ones. (not a fan, just configure them correctly!)

@td-famedly td-famedly requested a review from a team as a code owner August 16, 2024 11:19

try {
return request('_matrix/client/v1/media/config');
} catch (e) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we know the exact error message that would be returned here? Then we should listen to only this and rethrow other errors

try {
return request(
'_matrix/client/v1/media/download/${Uri.encodeComponent(serverName)}/${Uri.encodeComponent(mediaId)}');
} catch (e) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

try {
return request(
'_matrix/client/v1/media/download/${Uri.encodeComponent(serverName)}/${Uri.encodeComponent(mediaId)}/${Uri.encodeComponent(fileName)}');
} catch (e) {
Copy link
Contributor

Choose a reason for hiding this comment

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

And here


try {
return request('_matrix/client/v1/media/preview_url');
} catch (e) {
Copy link
Contributor

Choose a reason for hiding this comment

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

And here

Copy link
Contributor

@krille-chan krille-chan left a comment

Choose a reason for hiding this comment

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

Don't get it yet... why should we implement such a hacky workaround because of a misconfigured server? Shouldn't we fix the server instead?

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.

3 participants