element-hq / element-hq/element-android

[SSSS] User password is asked multiple times then the app crashes when trying to reset the recovery key.

Open
#8,861 3 comments 3 reactions 0 assignees View on GitHub
T-Defect
Dominant language
Kotlin
Stars
3.7k
Forks
917
PR merge metrics
No merged PRs in 30d

Description

### Steps to reproduce

case 1:

1. Go to Settings > Security & Privacy
2. In `Secure Backup` section tap on "Set up on this device".
3. Choose "Reset everything"
4. Tap on "Proceed to resest"
5. Select "Use a Security Key"
6. Enter your password

https://github.com/element-hq/element-android/assets/1191674/c1927459-a64c-4f03-8701-2f3dc43148e4

case 2:
1. secure_backup_required is enabled in wellknown configuration
2. Log in to Element Android
3. Choose "Reset everything"
4. Tap on "Proceed to resest"
5. Select "Use a Security Key"
6. Enter your password

https://github.com/element-hq/element-android/assets/1191674/8914c624-80eb-40f3-a174-2af753594af2

### Outcome

#### What did you expect?
Get a recovery key

#### What happened instead?
User password is asked multiple times and the app crashes.

`bootstrapTask` invoked from `startInitializeFlow` method is called multiple times :
- https://github.com/element-hq/element-android/blob/e3a878155b3808207e0fee8a5da89bc2b62e5ce2/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapSharedViewModel.kt#L225
- https://github.com/element-hq/element-android/blob/e3a878155b3808207e0fee8a5da89bc2b62e5ce2/vector/src/main/java/im/vector/app/features/crypto/recover/BootstrapSharedViewModel.kt#L297

### Your phone model

Pixel 8 Pro

### Operating system version

Android 14

### Application version and app store

Element 1.6.16

### Homeserver

matrix.org

### Will you send logs?

No

### Are you willing to provide a PR?

No

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.