Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip device verification screen when creating a new account using OIDC #3395

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Sep 4, 2024

Content

It can happen that the session is automatically verified and in this case the FTUE verification step has to be skipped.

This PR handle this.

Note that some shortcut had been taken to show the confirmation screen when the user enter a recovery key, so I had to add a parameter showDeviceVerifiedScreen to handle this case properly.

Motivation and context

Closes #3279

Screenshots / GIFs

Tests

  • Login using OIDC, creating a new account
  • The device verification screen must be skipped. A loader can be displayed for a short moment.

Note that I have seen the "Confirm your identity" for a few millis, it seems that the SDK emit a SessionVerifiedStatus.NotVerified between the SessionVerifiedStatus.Unknown and SessionVerifiedStatus.Verified, but I need to check again befor reporting to the SDK.

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 23
  • 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
  • Pull request includes a sign off
  • You've made a self review of your PR

@bmarty bmarty requested a review from a team as a code owner September 4, 2024 15:11
@bmarty bmarty requested review from ganfra and removed request for a team September 4, 2024 15:11
@@ -66,18 +75,32 @@ class VerifySelfSessionPresenter @Inject constructor(
val recoveryState by encryptionService.recoveryStateStateFlow.collectAsState()
val stateAndDispatch = stateMachine.rememberStateAndDispatch()
val skipVerification by sessionPreferencesStore.isSessionVerificationSkipped().collectAsState(initial = false)
val needsVerification by sessionVerificationService.needsSessionVerification.collectAsState(initial = true)
val sessionVerifiedStatus by sessionVerificationService.sessionVerifiedStatus.collectAsState()
Copy link
Member Author

Choose a reason for hiding this comment

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

Do not use needsSessionVerification to avoid the initial true value.

Copy link
Contributor

github-actions bot commented Sep 4, 2024

📱 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/ZH2cmE

Copy link

sonarcloud bot commented Sep 4, 2024

Copy link

codecov bot commented Sep 4, 2024

Codecov Report

Attention: Patch coverage is 85.41667% with 7 lines in your changes missing coverage. Please review.

Project coverage is 82.58%. Comparing base (2c8b0d0) to head (7c909c2).
Report is 17 commits behind head on develop.

Files with missing lines Patch % Lines
...atures/verifysession/impl/VerifySelfSessionView.kt 89.18% 0 Missing and 4 partials ⚠️
...rifysession/impl/DefaultVerifySessionEntryPoint.kt 0.00% 2 Missing ⚠️
...tures/verifysession/api/VerifySessionEntryPoint.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3395      +/-   ##
===========================================
- Coverage    82.60%   82.58%   -0.02%     
===========================================
  Files         1694     1695       +1     
  Lines        39651    39671      +20     
  Branches      4821     4827       +6     
===========================================
+ Hits         32752    32762      +10     
- Misses        5216     5220       +4     
- Partials      1683     1689       +6     

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

@bmarty bmarty added Run-Maestro Starts a Maestro Cloud session to run integration tests PR-Misc For other changes labels Sep 4, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Sep 4, 2024
@bmarty bmarty merged commit f9af2b8 into develop Sep 4, 2024
33 checks passed
@bmarty bmarty deleted the feature/bma/noDeviceVerifiedAfterRegistration branch September 4, 2024 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Misc For other changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Device verification success screen appears after a fresh new registration #3126
2 participants