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

Handle case when device cannot be verified #6475

Merged
merged 3 commits into from
Jul 26, 2022

Conversation

BillCarsonFr
Copy link
Member

@BillCarsonFr BillCarsonFr commented Jul 5, 2022

Type of change

  • Bugfix

Content

Fixes #6466

Motivation and context

When there is no way to verify a new device, prompt and propose to reset verifications keys.

Screenshots / GIFs

Before After
image image

This can be performed from settings also
image

A click on the popup will open the 4S setup bottomsheet

image

Tests

  • Step 1: Create an account then logout
  • Step 2: Login this account again

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

@BillCarsonFr BillCarsonFr requested review from a team and onurays and removed request for a team and onurays July 5, 2022 15:55
@bmarty bmarty requested review from a team and Florian14 and removed request for a team July 7, 2022 14:23
// secure backup is setup
val hasTargetDeviceToVerifyAgainst = session
.cryptoService()
.getUserDevices(session.myUserId)
Copy link
Member

Choose a reason for hiding this comment

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

Are we sure that all the user devices are known by the SDK at this point?

Copy link
Member Author

Choose a reason for hiding this comment

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

there is a force download call few lines before. But maybe i should switch to crypto context to avoid outof sync db?

}
}
}
} else if (!isMine) {
Copy link
Member

Choose a reason for hiding this comment

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

We are already in a if (isMine) block, so this is strange. Dead code?
Also line 197 could be simplified. No need to test if (!isMine)

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah strange I used the editor split condition and it did that, will review the logic

Copy link
Contributor

@Florian14 Florian14 left a comment

Choose a reason for hiding this comment

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

Not sure it has been changed in this PR but the "Reset everything" action sounds destructive, so I'd expect to show it in red, wdyt?

vector/src/main/res/values/strings.xml Outdated Show resolved Hide resolved
@BillCarsonFr
Copy link
Member Author

Not sure it has been changed in this PR but the "Reset everything" action sounds destructive, so I'd expect to show it in red, wdyt?

In this case you have no recovery method, nor other device to verify against. So reset is your only choice, there is nothing to destruct and that's what you hsould do.

@BillCarsonFr BillCarsonFr force-pushed the feature/bca/crypto_unable_self_verify branch from 9be5f91 to ed46ce6 Compare July 15, 2022 12:55
@BillCarsonFr BillCarsonFr force-pushed the feature/bca/crypto_unable_self_verify branch from ed46ce6 to ac7b47b Compare July 21, 2022 10:05
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@BillCarsonFr BillCarsonFr requested a review from bmarty July 22, 2022 08:38
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.

LGTM

@BillCarsonFr BillCarsonFr merged commit 8e2eb19 into develop Jul 26, 2022
@BillCarsonFr BillCarsonFr deleted the feature/bca/crypto_unable_self_verify branch July 26, 2022 14:12
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.

Verify this login toast pops up when there is no way to do it (no other devices or 4S)
3 participants