diff --git a/lib/src/client.dart b/lib/src/client.dart index e2eb3dad..a69c2693 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -519,14 +519,13 @@ class Client extends MatrixApi { /// including all persistent data from the store. @override Future logoutAll() async { - try { - await super.logoutAll(); - } catch (e, s) { + final futures = []; + 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. diff --git a/test_driver/matrixsdk_test.dart b/test_driver/matrixsdk_test.dart index a5d252ad..72844e51 100644 --- a/test_driver/matrixsdk_test.dart +++ b/test_driver/matrixsdk_test.dart @@ -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);