From f9423fc15e272479221758ab55a4be013cea885d Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 21 Jun 2023 09:35:21 +0200 Subject: [PATCH] Close the client before removing its data. Probably safer. --- .../element/android/libraries/matrix/impl/RustMatrixClient.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClient.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClient.kt index 773dc8d03b..776747270c 100644 --- a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClient.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClient.kt @@ -354,9 +354,9 @@ class RustMatrixClient constructor( } catch (failure: Throwable) { Timber.e(failure, "Fail to call logout on HS. Still delete local files.") } - baseDirectory.deleteSessionDirectory(userID = client.userId(), deleteCryptoDb = true) - sessionStore.removeSession(client.userId()) close() + baseDirectory.deleteSessionDirectory(userID = sessionId.value, deleteCryptoDb = true) + sessionStore.removeSession(sessionId.value) } override suspend fun loadUserDisplayName(): Result = withContext(dispatchers.io) {