From 59d4450b836dbfb7d80edb1f9d4b64e75399b80a Mon Sep 17 00:00:00 2001 From: yostyle Date: Fri, 6 Oct 2023 22:36:33 +0200 Subject: [PATCH] Add changelog --- changelog.d/979.bugfix | 1 + .../org/matrix/android/sdk/internal/crypto/RustCryptoService.kt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/979.bugfix diff --git a/changelog.d/979.bugfix b/changelog.d/979.bugfix new file mode 100644 index 0000000000..832cb06bd8 --- /dev/null +++ b/changelog.d/979.bugfix @@ -0,0 +1 @@ +Correction des messages chiffrés quand il existe qu'une seule session \ No newline at end of file diff --git a/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/RustCryptoService.kt b/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/RustCryptoService.kt index 09a2a7bccb..e7bfb93895 100755 --- a/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/RustCryptoService.kt +++ b/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/RustCryptoService.kt @@ -498,6 +498,7 @@ internal class RustCryptoService @Inject constructor( return try { olmMachine.decryptRoomEvent(event) } catch (mxCryptoError: MXCryptoError) { + // Tchap: try to perform a lazy migration from legacy store if there is no other session. if (mxCryptoError is MXCryptoError.Base && mxCryptoError.errorType == MXCryptoError.ErrorType.UNKNOWN_INBOUND_SESSION_ID) { Timber.v("Try to perform a lazy migration from legacy store") /** @@ -508,7 +509,6 @@ internal class RustCryptoService @Inject constructor( val sessionId = content.sessionId val senderKey = content.senderKey if (roomId != null && sessionId != null) { - // try to perform a lazy migration from legacy store val legacy = tryOrNull("Failed to access legacy crypto store") { cryptoStore.getInboundGroupSession(sessionId, senderKey.orEmpty()) }