* WIP support for state_after
* Fix sliding sync sdk / embedded tests
* Allow both state & state_after to be undefined
Since it must have allowed state to be undefined previously: the test
had it as such.
* Fix limited sync handling
* Need to use state_after being undefined
if state can be undefined anyway
* Make sliding sync sdk tests pass
* Remove deprecated interfaces & backwards-compat code
* Remove useless assignment
* Use updates unstable prefix
* Clarify docs
* Remove additional semi-backwards compatible overload
* Update unstable prefixes
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix test
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>
* Add test for MSC4222 behaviour
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Improve coverage
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix tests
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Tidy
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Add comments to explain why things work as they are.
* Fix sync accumulator for state_after sync handling
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Add tests
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Revert "Fix room state being updated with old (now overwritten) state and emitting for those updates. (#4242)"
This reverts commit 957329b218.
* Fix Sync Accumulator toJSON putting start timeline state in state_after field
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update tests
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Add test case
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>
Co-authored-by: Hugh Nimmo-Smith <hughns@matrix.org>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: Timo <toger5@hotmail.de>
* Ensure we disambiguate display names which look like MXIDs
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Make tests clearer
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* First draft of moving out restoreKeyBackup out of MatrixClient
* Deprecate `restoreKeyBackup*` in `MatrixClient`
* Move types
* Handle only the room keys response
* Renaming and refactor `keysCountInBatch` & `getTotalKeyCount`
* Fix `importRoomKeysAsJson` tsdoc
* Fix typo
* Move `backupDecryptor.free()``
* Comment and simplify a bit `handleDecryptionOfAFullBackup`
* Fix decryption crash by moving`backupDecryptor.free`
* Use new api in `megolm-backup.spec.ts`
* Add tests to get recovery key from secret storage
* Add doc to `KeyBackupRestoreOpts` & `KeyBackupRestoreResult`
* Add doc to `restoreKeyBackupWithKey`
* Add doc to `backup.ts`
* Apply comment suggestions
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* - Decryption key is recovered from the cache in `RustCrypto.restoreKeyBackup`
- Add `CryptoApi.getSecretStorageBackupPrivateKey` to get the decryption key from the secret storage.
* Add `CryptoApi.restoreKeyBackup` to `ImportRoomKeyProgressData` doc.
* Add deprecated symbol to all the `restoreKeyBackup*` overrides.
* Update tests
* Move `RustBackupManager.getTotalKeyCount` to `backup#calculateKeyCountInKeyBackup`
* Fix `RustBackupManager.restoreKeyBackup` tsdoc
* Move `backupDecryptor.free` in rust crypto.
* Move `handleDecryptionOfAFullBackup` in `importKeyBackup`
* Rename `calculateKeyCountInKeyBackup` to `countKeystInBackup`
* Fix `passphrase` typo
* Rename `backupInfoVersion` to `backupVersion`
* Complete restoreKeyBackup* methods documentation
* Add `loadSessionBackupPrivateKeyFromSecretStorage`
* Remove useless intermediary result variable.
* Check that decryption key matchs key backup info in `loadSessionBackupPrivateKeyFromSecretStorage`
* Get backup info from a specific version
* Fix typo in `countKeysInBackup`
* Improve documentation and naming
* Use `RustSdkCryptoJs.BackupDecryptionKey` as `decryptionKeyMatchesKeyBackupInfo` parameter.
* Call directly `olmMachine.getBackupKeys` in `restoreKeyBackup`
* Last review changes
---------
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>