element-android icon indicating copy to clipboard operation
element-android copied to clipboard

Respect the secure backup methods setting

Open ggajews opened this issue 2 years ago • 3 comments

Type of change

  • [ ] Feature
  • [x] Bugfix
  • [ ] Technical
  • [ ] Other :

Content

On the backend secure_backup_setup_methods is set to passphrase. Due to the bug app still allowed to select Security Key when setting up backup. The issue was that code loading the methods was executed after the BootstrapStep.FirstForm was created, and the step was not updated

        viewModelScope.launch(Dispatchers.IO) {
            val wellKnown = rawService.getElementWellknown(session.sessionParams)
            setState {
                copy(
                        isSecureBackupRequired = wellKnown?.isSecureBackupRequired().orFalse(),
                        secureBackupMethod = wellKnown?.secureBackupMethod() ?: SecureBackupMethod.KEY_OR_PASSPHRASE,
                )
            }
        }

Screenshots / GIFs

Before image

After image

Tests

Set elementE2E?.secureBackupSetupMethods to passphrase on the backend Open app with valid login Go to Security & Privacy settings Select "Reset Secure Backup"

Tested devices

  • [x] Physical
  • [ ] Emulator
  • OS version(s): Android 11

Checklist

  • [ ] Changes has been tested on an Android device or Android emulator with API 21
  • [ ] UI change has been tested on both light and dark themes
  • [ ] Accessibility has been taken into account. See https://github.com/vector-im/element-android/blob/develop/CONTRIBUTING.md#accessibility
  • [x] Pull request is based on the develop branch
  • [x] Pull request includes a new file under ./changelog.d. See https://github.com/vector-im/element-android/blob/develop/CONTRIBUTING.md#changelog
  • [x] Pull request includes screenshots or videos if containing UI changes
  • [ ] Pull request includes a sign off
  • [x] You've made a self review of your PR
  • [ ] If you have modified the screen flow, or added new screens to the application, you have updated the test UiAllScreensSanityTest.allScreensTest()

ggajews avatar Feb 10 '23 14:02 ggajews

Hello @ggajews , thanks for the proposal change. The description is quite clear and the changes look decent. I would defer to @BillCarsonFr for another approval.

Also can you add a sign off to your Pull request? More info here

bmarty avatar Feb 16 '23 08:02 bmarty

Hi @BillCarsonFr, will you find some time to review this small PR?

ggajews avatar Mar 31 '23 10:03 ggajews

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Sep 25 '24 12:09 CLAassistant