-
Notifications
You must be signed in to change notification settings - Fork 31
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
Conversation
1c0e1f5
to
17840b2
Compare
|
||
try { | ||
return request('_matrix/client/v1/media/config'); | ||
} catch (e) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here
There was a problem hiding this 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?
This removes the version checks, and expects clients to manually return both endpoints using the
useAuthentication
flagBreaking 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!)