* remove incorrect check for cross-signing
SETUP_ENCRYPTION tries to set up everything (4S, cross-signing and key backup),
rather than just setting up encryption, as its name would imply.
crossSigningReady == false happens when the user's device isn't verified, so it
should trigger VERIFY_THIS_SESSION rather than SETUP_ENCRYPTION
* reorder conditions in allSystemsReady to match the order in the if statements
* explicitly handle secrets missing from 4S
rather than falling back to the SETUP_ENCRYPTION catch-all. Also, remove
SETUP_ENCRYPTION since it is no longer used.
* convert button handlers to switch statements for consistency
(almost) all the other functions that use make decisions based on Kind use
switch statements
* update i18n (remove obsolete string)
* Show indicator in settings dialog when user doesn't have recovery set up
* Update settings headers to use red dot for recommended settings
* update recovery setup toast and remember if the user dismisses it
* update playwright snapshots
* use typed event emitters
* reverse logic for the account data flag
* fix comment and type
* Assert that we set backup_disabled when turning off key storage
* Prompt the user when key storage is unexpectedly off
* Playwright tests for the Turn on key storage toast
* DeviceListener: improve logging
use a LogSpan to tie together logs from the same run, and add some more logs
for various cases
* Regression playwright test
* Remove unused mocking of `getCrossSigningId`
DeviceListener no longer reads this thing
* Clean up unit tests
Remove redundant describe block
* Remove the "out of sync" toast when we are no longer out of sync
Receiving the crypto secrets via secret sharing should make the toast go away.
* Honour the backup disable flag from Element X
This unfortunately named and unspecced flag is set by Element X
to denote that the user has chosen to disable key storage and it
should not automatically try to enable it again. This changes Element
web to not prompt to enable recovery if this flag is set.
* Remove unnecessary conditional
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
* Refine `SettingsSection` & `SettingsTab`
* Add encryption tab
* Add recovery section
* Add device verification
* Rename `Panel` into `State`
* Update & add tests to user settings common
* Add tests to `RecoveryPanel`
* Add tests to `ChangeRecoveryKey`
* Update CreateSecretStorageDialog-test snapshot
* Add tests to `EncryptionUserSettingsTab`
* Update existing screenshots of e2e tests
* Add new encryption tab ownership to `@element-hq/element-crypto-web-reviewers`
* Add e2e tests
* Fix monospace font and add figma link to hardcoded value
* Add unit to Icon
* Improve e2e doc
* Assert that the crypto module is defined
* Add classname doc
* Fix typo
* Use `good` state instead of default
* Rename `ChangeRecoveryKey.isSetupFlow` into `ChangeRecoveryKey.userHasKeyBackup`
* Move `deleteCachedSecrets` fixture in `recovery.spec.ts`
* Use one callback instead of two in `RecoveryPanel`
* Fix docs and naming of `utils.createBot`
* Fix typo in `RecoveryPanel`
* Add more doc to the state of the `EncryptionUserSettingsTab`
* Rename `verification_required` into `set_up_encryption`
* Update test
* ADd new license
* Very early WIP of rejigged e2e error toast code
* Update comments and doc
* Assert that `recoveryKey.encodedPrivateKey` is always defined
* Add comments to explain how the secrets could be uncached
* Use `matrixClient.secretStorage.getDefaultKeyId` instead of `matrixClient.getCrypto().checkKeyBackupAndEnable` to know if we need to set up a recovery key
* Update existing screenshot to add encryption tab.
* Fix tests
* Remove unused file!
* Remove test for unused file
* Show 'set up encryption' in the 'other' case.
* Test 'key storage out of sync' toast
* Update tests
* Fix test & make toast look correct
* Use new labels when changing the recovery key
* Fix docs
* Don't reset key backup when creating a recovery key
* Add playwright test for toast
* Dismiss the toast as it's now in the way due to being wider
* Doesn't look like this needs to be async
* Typo
Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
* Typo
Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
* Override width for just this toast
---------
Co-authored-by: Florian Duros <florian.duros@ormaz.fr>
Co-authored-by: Florian Duros <florianduros@element.io>
Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
* Add commercial licence and update config files
* Update license in headers
* Revert "Update license in headers"
This reverts commit 7ed7949485.
* Update only spdx id
* Remove LicenseRef- from package.json
LicenseRef- no longer allowed in npm v3 package.json
This fixes the warning in the logs and failing build check.
* Factor out crypto setup process into a store
To make components pure and avoid react 18 dev mode problems due
to components making requests when mounted.
* fix test
* test for the store
* Add comment
* Enable key backup by default
When we set up cross signing, so the key backup key will be stored locally along with the cross signing keys until the user sets up recovery (4s). This will mean that a user can restore their backup if they log in on a new device as long as they verify with the one they registered on.
Replaces https://github.com/element-hq/element-web/pull/28267
* Fix test
* Prompt user to set up 4S on logout
* Fix test
* Add playwright test for key backup by default
* Fix imports
* This isn't unexpected anymore
* Update doc
* Fix docs and function name on renderSetupBackupDialog()
* Use checkKeyBackupAndEnable
* Docs for setup encryption toast
* Also test the toast appears
* Update mock for the method we use now
* Okay fine I guess we need both
* Swap here too
* Fix comment & doc comments
* Use `CryptoApi.getKeyBackupInfo` instead of deprecated `MatrixClient.getKeyBackupVersion`
* Review changes
---------
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
* Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `DeviceListener.ts`
* Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `Searching.ts`
* Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `SlidingSyncManager.ts`
* Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `EncryptionEvent.tsx`
* Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `ReportEventDialog.tsx`
* Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `RoomNotifications.tsx`
* Fix MessagePanel-test.tsx
* ReplaceReplace `MatrixCient..isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `shouldSkipSetupEncryption.ts`
* Add missing `await`
* Use `Promise.any` instead of `asyncSome`
* Add `asyncSomeParallel`
* Use `asyncSomeParallel` instead of `asyncSome`
* Remove boilerplate around dispatcher and settings watchers
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>