From f03bd282e7eb623d4ef026443e89fcbfc940bf65 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 2 Sep 2024 11:29:44 +0200 Subject: [PATCH] Change the way we do not delete the crypto database. --- .../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 f346100de1..089240c94c 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 @@ -645,9 +645,9 @@ class RustMatrixClient( // Delete the folder and all its content sessionPaths.fileDirectory.deleteRecursively() } else { - // Delete only the state.db file + // Do not delete the crypto database files. sessionPaths.fileDirectory.listFiles().orEmpty() - .filter { it.name.contains("matrix-sdk-state") } + .filterNot { it.name.contains("matrix-sdk-crypto") } .forEach { file -> Timber.w("Deleting file ${file.name}...") file.safeDelete()