Skip to content

Conversation

@bmarty
Copy link
Member

@bmarty bmarty commented Nov 6, 2025

Content

Ensure that the user can always get an explicit error up on what has been entered. Either there is no homeserver at the provided url, either the homeserver does not support login password not Oidc flow.

Motivation and context

Give explicit error to users.
Help #4556 and #5627

Screenshots / GIFs

Tests

  • Start the app (no existing sessions)
  • Click on "Sign in manually"
  • Click on "Change account provider"
  • Click on "Other"
  • In the text field, enter an invalid homewerver url (for instance "invalid.com")
  • Observe that "invalid.com" appears as a candidate. This is new. Previously https://invalid.com had to be entered for the candidate to appear.
image
  • Click on the candidate
  • An error is displayed
image
  • Close the dialog
  • Enter the url of a homeserver that does not support OIDC nor password, for instance matrix.debian.social.
  • Observe that "matrix.debian.social" appears as a candidate
  • click on the candidate
  • Observe the specific error
image

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • 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 define 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

@bmarty bmarty added PR-Change For updates to an existing feature Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. labels Nov 6, 2025
@github-actions github-actions bot removed the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Nov 6, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/4RqtE6

@bmarty bmarty marked this pull request as ready for review November 6, 2025 15:20
@bmarty bmarty requested a review from a team as a code owner November 6, 2025 15:20
@bmarty bmarty requested review from ganfra and removed request for a team November 6, 2025 15:20
@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

❌ Patch coverage is 73.61111% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.64%. Comparing base (c1da482) to head (fe2a317).
⚠️ Report is 49 commits behind head on develop.

Files with missing lines Patch % Lines
...atures/login/impl/changeserver/ChangeServerView.kt 38.46% 6 Missing and 2 partials ⚠️
...oid/features/login/impl/error/ChangeServerError.kt 33.33% 6 Missing and 2 partials ⚠️
...android/features/login/impl/login/LoginModeView.kt 90.00% 0 Missing and 1 partial ⚠️
...features/login/impl/resolver/HomeserverResolver.kt 50.00% 0 Missing and 1 partial ⚠️
...atrix/impl/auth/RustMatrixAuthenticationService.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5692      +/-   ##
===========================================
- Coverage    79.65%   79.64%   -0.01%     
===========================================
  Files         2427     2428       +1     
  Lines        65212    65242      +30     
  Branches      8318     8328      +10     
===========================================
+ Hits         51945    51963      +18     
- Misses       10291    10300       +9     
- Partials      2976     2979       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

accountProviderDataSource.userSelection(data)
}.getOrThrow()
val details = authenticationService.setHomeserver(data.url).getOrThrow()
if (details.supportsOidcLogin.not() && details.supportsPasswordLogin.not()) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm not a big fan of not...

Copy link
Member Author

Choose a reason for hiding this comment

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

You just used it in your comment :).
I have updated the code.

val details = authenticationService.setHomeserver(data.url).getOrThrow()
if (details.supportsOidcLogin.not() && details.supportsPasswordLogin.not()) {
// Unsupported homeserver
throw ChangeServerError.Error(
Copy link
Member

Choose a reason for hiding this comment

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

I'd remove this Error which is a bit confusing, and create individual error for all the defined errors + one Unknown case for the default behavior

Copy link
Member Author

Choose a reason for hiding this comment

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

I have done that and improve the error mapping.

@bmarty bmarty requested a review from ganfra November 7, 2025 09:19
@bmarty bmarty added the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Nov 7, 2025
@github-actions github-actions bot removed the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Nov 7, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 7, 2025

@bmarty bmarty merged commit 77bc9b8 into develop Nov 7, 2025
29 of 32 checks passed
@bmarty bmarty deleted the feature/bma/loginFlow branch November 7, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR-Change For updates to an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants