Add default_server_config fallback to element.io configs - #19695
Conversation
This doesn't fix element-hq#11154 but at least prevents it from happening on app.element.io and develop.element.io. `default_server_name` is also deprecated. I will create a PR for desktop if this is acceptable. Signed-off-by: Aaron Raimist <aaron@raim.ist>
|
The only downside to this is the full base_url will be displayed on the login/registration screens rather than the server name. The documentation claims aaronraimist/matrix-js-sdk@0303c9b would make it work however there wouldn't be any validation of the server name so it could easily be used for phishing. I'm not quite sure how you could validate it. I suppose someone hosting an instance of Element already has to be trusted not to modify Element so that may not be a big deal. |
|
Been waiting for this for a long time. |
turt2live
left a comment
There was a problem hiding this comment.
Thanks! What are the chances a similar change can be made to the element-desktop repository?
|
@turt2live 100%. Do you want #19695 (comment) as well? |
|
oh, hmm, didn't realize that this would cause the issue mentioned in that comment. I think instead we need to spend a bit of time to think about this, sorry. |
|
@t3chguy , Do you think this is ready to be merged? |
|
so in the end we've un-deprecated Curious to hear thoughts on the matter. |
|
@turt2live Personally I think it is a problem. I see it pop up in I also think it is an under reported issue because if someone gets this error, there is absolutely nothing to suggest it is a problem on your end. People likely just think: well something is broken, this sucks I'm going back to Discord/Slack/etc. |
|
Is there anything blocking this PR from being merged? |
|
We don't think we can merge this while it displays |
|
在 2023-06-22 22:29,Andy Balaam 写道:
We don't think we can merge this while it displays matrix-client on
the front page. Would someone be willing to change the code to allow
us to display matrix.org there, even when we provided this info?
Propose this:
1. If only `default_server_name` is provided, use well-known discovery
and bails out if it fails (like before).
2. If only `default_server_config` is provided, use it only.
3. If both `default_server_config` and `default_server_name` is provided
in the config, try well-known discovery first, it that fails, use the
configuration in `default_server_config` instead. (More specially, use
the content of `default_server_config` as a fallback discovery info).
Unfortunately I can't provide code that are tested because GFW blocks
gitlab.matrix.org which is required to set up the dev environment and to
test my code.
|
|
My proposed patch can be found at element-web.patch. |
|
We discussed this last week and @t3chguy will work on getting this into mergeable state. |
|
So the precursor to this is #25682 once that lands this PR should be updated to not remove the |
default_server_name to default_server_configdefault_server_config fallback to element.io configs
|
Now that #25682 has landed this PR no longer needs to remove the preferred |
This doesn't solve #11154 but at least prevents it from happening on app.element.io and develop.element.io.
default_server_nameis also deprecated.This PR greatly improves the user experience when matrix.org is unreachable. Currently it looks like this:

The error message doesn't provide much information about what went wrong and there is no way to switch to another server.
After this PR:

The error message actually says something meaningful and the user is able to switch to another server.
I will create a PR for desktop if this is acceptable.
This change is marked as an internal change (Task), so will not be included in the changelog.