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

Session falsely displayed as 'verified' with no internet connection #2884

Merged
merged 3 commits into from
May 21, 2024

Conversation

jmartinesp
Copy link
Member

@jmartinesp jmartinesp commented May 21, 2024

Remove the need to wait for isReady for SessionVerificationService.canVerifySessionFlow to fix this.

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

  • Remove the need to check whether the sliding sync state is running to have a 'needs to verify' state.

Motivation and context

When no internet connection was found or the sliding sync process wasn't running, sessions were falsely being displayed in UI as verified although they were unverified.

Screenshots / GIFs

auto-verified.mp4

Tests

  • Log into an account.
  • When getting into the 'verify your session' screen, disable every source of internet connection.
  • If it doesn't get into the 'device verified' screen, it's working.

I couldn't find any side effects, but it might be worth it double checking those.

Tested devices

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

Checklist

Remove the need to wait for `isReady` for `SessionVerificationService.canVerifySessionFlow` to fix this.
Copy link
Contributor

github-actions bot commented May 21, 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/EMibmY

Copy link

codecov bot commented May 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.30%. Comparing base (5d8cc80) to head (e50b358).
Report is 5 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2884      +/-   ##
===========================================
- Coverage    74.30%   74.30%   -0.01%     
===========================================
  Files         1530     1530              
  Lines        36524    36521       -3     
  Branches      7054     7054              
===========================================
- Hits         27140    27137       -3     
  Misses        5698     5698              
  Partials      3686     3686              

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

@jmartinesp jmartinesp marked this pull request as ready for review May 21, 2024 07:43
@jmartinesp jmartinesp requested a review from a team as a code owner May 21, 2024 07:43
@jmartinesp jmartinesp requested review from bmarty and removed request for a team May 21, 2024 07:43
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.

OK, but as you said, it's hard to see if they can have some side effects...

@@ -39,7 +39,7 @@ interface SessionVerificationService {
val sessionVerifiedStatus: StateFlow<SessionVerifiedStatus>

/**
* Returns whether the current session needs to be verified and the SDK is ready to start the verification.
* Returns whether the current session needs to be verified.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe take the opportunity to rename canVerifySessionFlow to mustVerifySessionFlow or needToVerifySessionFlow for clarity?

Also SessionVerificationService.isReady is not used externally, so maybe remove it from the interface?

override val canVerifySessionFlow = combine(sessionVerifiedStatus, isReady) { verificationStatus, isReady ->
isReady && verificationStatus == SessionVerifiedStatus.NotVerified
override val canVerifySessionFlow = sessionVerifiedStatus.map { verificationStatus ->
verificationStatus == SessionVerifiedStatus.NotVerified
Copy link
Member

Choose a reason for hiding this comment

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

I understand that if the verificationStatus get the value SessionVerifiedStatus.NotVerified, it means that the sliding sync is ready, but I am not 100% sure.

- Rename `SessionVerificationService.canVerifySessionFlow` to `needsSessionVerification`.
- Make `isReady` private.
@jmartinesp jmartinesp added the Run-Maestro Starts a Maestro Cloud session to run integration tests label May 21, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label May 21, 2024
Copy link

sonarcloud bot commented May 21, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@jmartinesp jmartinesp enabled auto-merge (squash) May 21, 2024 11:21
@jmartinesp jmartinesp merged commit 3f2413b into develop May 21, 2024
25 checks passed
@jmartinesp jmartinesp deleted the fix/jme/session-falsely-display-as-verified branch May 21, 2024 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants