fix: buggy e2e test

Signed-off-by: Lanna Michalke <l.michalke@famedly.com>
This commit is contained in:
Lanna Michalke 2022-05-23 14:18:46 +02:00
parent 039062bfdf
commit dd76e652bf
2 changed files with 10 additions and 7 deletions

View File

@ -519,14 +519,13 @@ class Client extends MatrixApi {
/// including all persistent data from the store.
@override
Future<void> logoutAll() async {
try {
await super.logoutAll();
} catch (e, s) {
final futures = <Future>[];
futures.add(super.logoutAll());
futures.add(clear());
await Future.wait(futures).catchError((e, s) {
Logs().e('Logout all failed', e, s);
rethrow;
} finally {
await clear();
}
throw e;
});
}
/// Run any request and react on user interactive authentication flows here.

View File

@ -130,6 +130,10 @@ void test() async {
.deviceKeys[testClientA.deviceID!]!.verified);
assert(!testClientB.userDeviceKeys[TestUser.username]!
.deviceKeys[testClientA.deviceID!]!.blocked);
await Future.wait([
testClientA.updateUserDeviceKeys(),
testClientB.updateUserDeviceKeys(),
]);
await testClientA
.userDeviceKeys[TestUser.username2]!.deviceKeys[testClientB.deviceID!]!
.setVerified(true);