Skip to content

Name the homeserver's administrator when it cannot be reached - #7553

Open
hayaksi1 wants to merge 2 commits into
element-hq:developfrom
hayaksi1:fix/4556-homeserver-support-contact
Open

Name the homeserver's administrator when it cannot be reached#7553
hayaksi1 wants to merge 2 commits into
element-hq:developfrom
hayaksi1:fix/4556-homeserver-support-contact

Conversation

@hayaksi1

Copy link
Copy Markdown
Contributor

Content

"We couldn't reach this homeserver" tells the user to contact an administrator without saying who
that is. The Matrix spec has a place for that answer:
GET /.well-known/matrix/support,
served by the delegating domain rather than the homeserver API, so it usually answers even when the
API does not — which is exactly the case in the report.

On the failure path only, the login flow now reads that file and adds the administrator's email
address, Matrix ID or support page to the dialog. An admin contact is preferred over the other roles,
an email address over a Matrix ID, and the support page is the last resort. A homeserver that
advertises nothing, or that cannot be reached at all, keeps today's text — the lookup never fails the
login, and it never runs on the success path.

Deliberately out of scope: raising the log level during authentication and offering the logs from the
dialog, the other half of manuroe's comment.

Motivation and context

Part of #4556. manuroe, reopening it as an enhancement: "And to really finish the work, we need to
add the admin details in this error popup as adverstised by GET /.well-known/matrix/support."

Tests

  • HomeserverSupportContactProviderTest — role preference, email over Matrix ID, support page as the
    last resort, and nothing advertised.
  • OnBoardingPresenterTest — an unreachable homeserver produces
    ChangeServerError.InvalidServer(supportContact = …) when one is advertised and
    ChangeServerError.InvalidServer() when not.
  • Negative control: dropping the enrichment makes present - an unreachable homeserver reports the administrator it advertises fail.
  • ./gradlew :features:login:impl:testDebugUnitTest :features:login:impl:ktlintCheck :features:login:impl:detekt — green.
  • The dialog variant is covered by a new ChangeServerErrorPreviewParam value, appended last so the
    existing goldens keep their indices; the two new ones were recorded by CI.

Tested devices

  • Physical
  • Emulator
  • OS version(s): unit tests and Composable previews

Checklist

  • I am aware of the etiquette.
  • This PR was made with the help of AI:
    • Yes. In this case, please request a review by Copilot.
    • No.
  • Changes have been tested on an Android device or Android emulator with API 24
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly defines what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • You've made a self review of your PR

@hayaksi1
hayaksi1 requested a review from a team as a code owner August 25, 2026 14:41
@hayaksi1
hayaksi1 requested review from bmarty and removed request for a team August 25, 2026 14:41
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible:

  • If your pull request adds a feature or modifies the UI, this should have an equivalent pull request in the Element X iOS repo unless it only affects an Android-only behaviour or is behind a disabled feature flag, since we need parity in both clients to consider a feature done. It will also need to be approved by our product and design teams before being merged, so it's usually a good idea to discuss the changes in a Github issue first and then start working on them once the approach has been validated.
  • Your branch should be based on origin/develop, at least when it was created.
  • The title of the PR will be used for release notes, so it needs to describe the change visible to the user.
  • The test pass locally running ./gradlew test.
  • The code quality check suite pass locally running ./gradlew runQualityChecks.
  • If you modified anything related to the UI, including previews, you'll have to run the Record screenshots GH action in your forked repo: that will generate compatible new screenshots. However, given Github Actions limitations, it will prevent the CI from running temporarily, until you upload a new commit after that one. To do so, just pull the latest changes and push an empty commit.

@github-actions github-actions Bot added the Z-Community-PR Issue is solved by a community member's PR label Aug 25, 2026
"We couldn't reach this homeserver" leaves the user with nobody to ask.
The Matrix spec has a place for that answer — /.well-known/matrix/support,
served by the delegating domain, so it usually answers even when the
homeserver API does not.

Read it on the failure path only and add the administrator's email
address, Matrix ID or support page to the dialog. A homeserver that
advertises nothing, or that cannot be reached at all, keeps today's text.

Part of element-hq#4556.
@hayaksi1
hayaksi1 force-pushed the fix/4556-homeserver-support-contact branch from d9d2c98 to f024293 Compare August 25, 2026 15:53

@bmarty bmarty left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the enhancement.

Since the Matrix specs is defining where the administrator can be reached, the change has to be located in the SDK first. Probably ClientBuildException.ServerUnreachable should carry the admin email if available.

hayaksi1 added a commit to hayaksi1/matrix-rust-sdk that referenced this pull request Aug 26, 2026
"We couldn't reach this homeserver" tells the user to contact an
administrator without saying who that is. The spec has a place for that
answer: GET /.well-known/matrix/support. It is served by the delegating
domain rather than by the homeserver API, so it usually answers even when
the API does not, which is exactly the case where a client needs it.

discover_server_support reads that file for a server name or homeserver
URL, without needing a Client, so it can be called after a client build
has already failed. The FFI wraps it and returns None when the server
advertises nothing or cannot be reached at all, since either way there is
nobody to name.

Sits behind element-hq/element-x-android#7553.
@hayaksi1

Copy link
Copy Markdown
Contributor Author

Moved the lookup into the SDK as suggested: matrix-org/matrix-rust-sdk#6924. I'll rework this PR on top of it once that lands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Z-Community-PR Issue is solved by a community member's PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants