You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Well-known feature has been introduced to let any Matrix client to discover where is located the client-server Matrix API, either when the user enters a domain or if the user enter a matrixId (userId) from which the domain can be extracted.
So the base url for the client-server API has to be https://matrix-client.matrix.org.
Element Android handles this correctly (#2843 exists though), but in fact the well-known file has been hacked on some servers to also store extra data, for instance some client configuration settings.
Moreover, when the user logins, the login response can contain another client-server URL, see https://matrix.org/docs/spec/client_server/r0.6.1#post-matrix-client-r0-login , the parameter Discovery Information, which is also supported by Element Android. This URL will override the previous store homeserver url, and the url entered by the client is lost (can be changed twice!).
We can see that in the current general setting screen in Element Android:
This is the same in the homeserver setting screen:
GetWellknownTask.Params should not take a matrixId anymore, but rather take a domain name. It will allow to perform a wellknown request after the login phase, to any desire domain. Also there will be no need anymore to create fake userId from a domain to do that.
We should store in HomeServerConnectionConfig object the homeserver url which has been entered by the user, to be able to later perform the same Wellknown request, even if the URL has been overridden by wellknown, or by the login response. On some circumstances, this is not OK to retrieve the domain from the userId. New field will be:
val userHomeServer:Uri
Also this URL could be used in the settings screen. A new section could be added to see the actual client-server API URL (the one which is displayed now).
Other
There are some old sessions which are still using matrix.org as a base URL for CS-API. This can be an opportunity to migrate the session database (SessionParamsEntity):
deserialize HomeServerConnectionConfig
force the usage of https://matrix-client.matrix.org if and only if the server url is matrix.org. For other servers, we can assume that the URL are the same. So userHomeServer will be https://matrix.org and homeServerUri will be overridden to https://matrix-client.matrix.org
serialize the object and write it to DB.
The text was updated successfully, but these errors were encountered:
Well-known feature has been introduced to let any Matrix client to discover where is located the client-server Matrix API, either when the user enters a domain or if the user enter a matrixId (userId) from which the domain can be extracted.
For instance, for the domain
matrix.org
, the well-known URL is https://matrix.org/.well-known/matrix/clientAnd the result is:
So the base url for the client-server API has to be
https://matrix-client.matrix.org
.Element Android handles this correctly (#2843 exists though), but in fact the well-known file has been hacked on some servers to also store extra data, for instance some client configuration settings.
Moreover, when the user logins, the login response can contain another client-server URL, see https://matrix.org/docs/spec/client_server/r0.6.1#post-matrix-client-r0-login , the parameter
Discovery Information
, which is also supported by Element Android. This URL will override the previous store homeserver url, and the url entered by the client is lost (can be changed twice!).We can see that in the current general setting screen in Element Android:
This is the same in the homeserver setting screen:
It's also worth noting that https://matrix-client.matrix.org/.well-known/matrix/client does not return anything (it's actually a non sense).
What we have to do
GetWellknownTask.Params
should not take amatrixId
anymore, but rather take adomain
name. It will allow to perform a wellknown request after the login phase, to any desire domain. Also there will be no need anymore to create fake userId from a domain to do that.We should store in
HomeServerConnectionConfig
object the homeserver url which has been entered by the user, to be able to later perform the same Wellknown request, even if the URL has been overridden by wellknown, or by the login response. On some circumstances, this is not OK to retrieve the domain from the userId. New field will be:Also this URL could be used in the settings screen. A new section could be added to see the actual client-server API URL (the one which is displayed now).
Other
There are some old sessions which are still using matrix.org as a base URL for CS-API. This can be an opportunity to migrate the session database (SessionParamsEntity):
HomeServerConnectionConfig
https://matrix-client.matrix.org
if and only if the server url is matrix.org. For other servers, we can assume that the URL are the same. SouserHomeServer
will behttps://matrix.org
andhomeServerUri
will be overridden tohttps://matrix-client.matrix.org
The text was updated successfully, but these errors were encountered: