Skip to content

Conversation

@jmartinesp
Copy link
Member

Content

  • Create a new AuthScope with its AuthGraph that will be reset each time the user starts a new type of login/account creation attempt.
  • Make existing login/account creation classes be scoped to it so their state is provided and reset with it.
  • When an account creation action is used, set LoginHelper.isAccountCreation to true so we can later provide it to the MatrixAuthenticationService.
  • RustMatrixAuthenticationService will now perform a sync when isAccountCreation == true and wait until we receive the verification state or the attempt times out after 10 seconds.
  • Rename Login* classes to Authentication* classes if they handle both logins and account creation flows.

Motivation and context

Fixes #5812.

Tests

  • Create a new account in some HS with OIDC enabled (i.e. matrix.org).
  • Check no verification flow step is displayed in the FTUE after completing the account creation flow.

I tested this with multi-account, but it should be the same without it.

Tested devices

  • Physical
  • Emulator
  • OS version(s): 16

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

@jmartinesp jmartinesp added the PR-Bugfix For bug fix label Dec 4, 2025
@jmartinesp jmartinesp requested a review from a team as a code owner December 4, 2025 12:23
@jmartinesp jmartinesp requested review from bmarty and removed request for a team December 4, 2025 12:23
@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 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/vCcqR1

@codecov
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

❌ Patch coverage is 74.00000% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.41%. Comparing base (fd48e73) to head (69fffff).

Files with missing lines Patch % Lines
...atrix/impl/auth/RustMatrixAuthenticationService.kt 0.00% 17 Missing ⚠️
...mpl/verification/RustSessionVerificationService.kt 0.00% 4 Missing ⚠️
...lement/android/features/login/impl/di/AuthScope.kt 0.00% 1 Missing ⚠️
.../features/login/impl/login/AuthenticationHelper.kt 95.65% 0 Missing and 1 partial ⚠️
...firmaccountprovider/ConfirmAccountProviderState.kt 66.66% 0 Missing and 1 partial ⚠️
...gin/impl/screens/onboarding/OnBoardingPresenter.kt 80.00% 1 Missing ⚠️
...s/login/impl/screens/onboarding/OnBoardingState.kt 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5850      +/-   ##
===========================================
- Coverage    81.43%   81.41%   -0.02%     
===========================================
  Files         2475     2475              
  Lines        66127    66142      +15     
  Branches      8419     8422       +3     
===========================================
- Hits         53852    53851       -1     
- Misses        9174     9190      +16     
  Partials      3101     3101              

☔ 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.

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

The code looks correct but when I tried to create an account, I observed the issue: the screen "Confirm your identity" was displayed.

The logs are here if it helps: https://github.com/element-hq/element-x-android-rageshakes/issues/8934

@jmartinesp
Copy link
Member Author

The code looks correct but when I tried to create an account, I observed the issue: the screen "Confirm your identity" was displayed.

The logs are here if it helps: element-hq/element-x-android-rageshakes#8934

Sorry to ask, but are you sure you tested the right branch? I see in the logs a behaviour that should display a log line that isn't there, which is weird. Maybe I can upload a version with more logs and you can re-test it so we can get more info?

…the user starts a new login/registration attempt from the onboarding screen
…he `AuthScope` so their state is provided and reset also for each attempt
…an provide it later to `MatrixAuthenticationService.loginWithOidc`

Then, when an account creation is detected, wait until the verification state is updated to `VERIFIED` or a timeout happens.

Move the existing login in `CreateAccountPresenter.importSession` to `MatrixAuthenticationService` too so this check is more centralised
…account creation

Do the same for other `Login*` classes that handle both login and account creation
@jmartinesp jmartinesp force-pushed the fix/unverified-after-account-creation branch from 351d1a1 to 105ac7b Compare December 9, 2025 09:31
@jmartinesp jmartinesp added the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Dec 9, 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 Dec 9, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 9, 2025

@jmartinesp jmartinesp requested a review from bmarty December 10, 2025 09:13
@bmarty
Copy link
Member

bmarty commented Dec 10, 2025

I my commit is 351d1a1 according to this log: https://rageshakes.element.io/api/listing/2025-12-08/134651-22LSU56H/logs.2025-12-08-13.log.gz and the app I still have on my phone, and I think I downloaded the app from Diawi. Maybe the link was outdated...

I'll test again

@bmarty
Copy link
Member

bmarty commented Dec 11, 2025

So tested again after building the app locally and creating a new account on matrix.org (benoitxx2) and I still have this screen displayed:

image

Commit:
image

Logs: https://github.com/element-hq/element-x-android-rageshakes/issues/8968

@bmarty
Copy link
Member

bmarty commented Dec 11, 2025

So my use case to repro the issue was that I created the account on the MAS page, but initially in the first screen of the application I clicked on "Sign in manually" instead of "Create account".

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

Labels

PR-Bugfix For bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong verify account step after creating a new account

4 participants