From 154d79d4b53efe2338ec3b7e1687b32ee295ff68 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 Jul 2026 13:45:07 +0000 Subject: [PATCH 1/4] Update dependency org.matrix.rustcomponents:sdk-android to v26.07.28 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e92757182f..b9c7fb1c98 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -185,7 +185,7 @@ test_detekt_test = { module = "io.gitlab.arturbosch.detekt:detekt-test", version # https://github.com/matrix-org/matrix-rust-components-kotlin/commits/main/sdk/sdk-android/src/main/kotlin/org/matrix/rustcomponents/sdk/matrix_sdk_ffi.kt # All new features should not be implemented in the pull request that upgrades the version, developers should # only fix API breaks and may add some TODOs. -matrix_sdk = "org.matrix.rustcomponents:sdk-android:26.07.23" +matrix_sdk = "org.matrix.rustcomponents:sdk-android:26.07.28" # Others coil = { module = "io.coil-kt.coil3:coil", version.ref = "coil" } From bd4d0cb02b68f55f4149dc5f412644f1cc33d389 Mon Sep 17 00:00:00 2001 From: ganfra Date: Tue, 28 Jul 2026 16:44:07 +0200 Subject: [PATCH 2/4] Fix compilation for QR login continuation error variants added in SDK 26.07.28 --- .../android/features/login/impl/qrcode/QrCodeLoginFlowNode.kt | 2 ++ .../libraries/matrix/api/auth/qrlogin/QrLoginException.kt | 2 ++ .../android/libraries/matrix/impl/auth/qrlogin/QrErrorMapper.kt | 2 ++ 3 files changed, 6 insertions(+) diff --git a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/qrcode/QrCodeLoginFlowNode.kt b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/qrcode/QrCodeLoginFlowNode.kt index 03264551a5..6d46cdea0f 100644 --- a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/qrcode/QrCodeLoginFlowNode.kt +++ b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/qrcode/QrCodeLoginFlowNode.kt @@ -141,6 +141,8 @@ class QrCodeLoginFlowNode( } QrLoginException.CheckCodeAlreadySent, QrLoginException.CheckCodeCannotBeSent, + QrLoginException.ContinuationAlreadySent, + QrLoginException.ContinuationCannotBeSent, QrLoginException.UnsupportedQrCodeType, QrLoginException.Unknown -> { Timber.e(error, "Unknown error found") diff --git a/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/auth/qrlogin/QrLoginException.kt b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/auth/qrlogin/QrLoginException.kt index 3f22244405..11c646650e 100644 --- a/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/auth/qrlogin/QrLoginException.kt +++ b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/auth/qrlogin/QrLoginException.kt @@ -20,6 +20,8 @@ sealed class QrLoginException : Exception() { data object OtherDeviceNotSignedIn : QrLoginException() data object CheckCodeAlreadySent : QrLoginException() data object CheckCodeCannotBeSent : QrLoginException() + data object ContinuationAlreadySent : QrLoginException() + data object ContinuationCannotBeSent : QrLoginException() data object UnsupportedQrCodeType : QrLoginException() data object Unknown : QrLoginException() } diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/auth/qrlogin/QrErrorMapper.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/auth/qrlogin/QrErrorMapper.kt index 23b9c6be5e..ed00db82e4 100644 --- a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/auth/qrlogin/QrErrorMapper.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/auth/qrlogin/QrErrorMapper.kt @@ -46,6 +46,8 @@ object QrErrorMapper { is RustHumanQrLoginException.SlidingSyncNotAvailable -> QrLoginException.SlidingSyncNotAvailable is RustHumanQrLoginException.CheckCodeAlreadySent -> QrLoginException.CheckCodeAlreadySent is RustHumanQrLoginException.CheckCodeCannotBeSent -> QrLoginException.CheckCodeCannotBeSent + is RustHumanQrLoginException.ContinuationAlreadySent -> QrLoginException.ContinuationAlreadySent + is RustHumanQrLoginException.ContinuationCannotBeSent -> QrLoginException.ContinuationCannotBeSent is RustHumanQrLoginException.UnsupportedQrCodeType -> QrLoginException.UnsupportedQrCodeType } } From 3fc89724640b32b3a2738191c276edc44cbd0555 Mon Sep 17 00:00:00 2001 From: ganfra Date: Tue, 28 Jul 2026 18:08:10 +0200 Subject: [PATCH 3/4] Fix unit test compilation for new continuationSender param on WaitingForAuth --- .../fakes/FakeFfiContinuationMessageSender.kt | 24 +++++++++++++++++++ .../RustLinkDesktopHandlerTest.kt | 3 ++- .../RustLinkMobileHandlerTest.kt | 3 ++- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/fixtures/fakes/FakeFfiContinuationMessageSender.kt diff --git a/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/fixtures/fakes/FakeFfiContinuationMessageSender.kt b/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/fixtures/fakes/FakeFfiContinuationMessageSender.kt new file mode 100644 index 0000000000..7c504003f0 --- /dev/null +++ b/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/fixtures/fakes/FakeFfiContinuationMessageSender.kt @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2025 Element Creations Ltd. + * + * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial. + */ + +package io.element.android.libraries.matrix.impl.fixtures.fakes + +import io.element.android.tests.testutils.lambda.lambdaError +import org.matrix.rustcomponents.sdk.ContinuationMessageSender +import org.matrix.rustcomponents.sdk.NoHandle + +class FakeFfiContinuationMessageSender( + private val confirmResult: () -> Unit = { lambdaError() }, + private val cancelResult: () -> Unit = { lambdaError() }, +) : ContinuationMessageSender(NoHandle) { + override suspend fun confirm() { + confirmResult() + } + + override suspend fun cancel() { + cancelResult() + } +} diff --git a/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/linknewdevice/RustLinkDesktopHandlerTest.kt b/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/linknewdevice/RustLinkDesktopHandlerTest.kt index fd635e2da6..c0781972ac 100644 --- a/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/linknewdevice/RustLinkDesktopHandlerTest.kt +++ b/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/linknewdevice/RustLinkDesktopHandlerTest.kt @@ -13,6 +13,7 @@ import app.cash.turbine.test import com.google.common.truth.Truth.assertThat import io.element.android.libraries.matrix.api.linknewdevice.ErrorType import io.element.android.libraries.matrix.api.linknewdevice.LinkDesktopStep +import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiContinuationMessageSender import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiGrantLoginWithQrCodeHandler import io.element.android.libraries.matrix.test.QR_CODE_DATA import kotlinx.coroutines.CompletableDeferred @@ -51,7 +52,7 @@ class RustLinkDesktopHandlerTest { listOf( GrantQrLoginProgress.Starting to LinkDesktopStep.Starting, GrantQrLoginProgress.SyncingSecrets to LinkDesktopStep.SyncingSecrets, - GrantQrLoginProgress.WaitingForAuth("aVerificationUri") + GrantQrLoginProgress.WaitingForAuth("aVerificationUri", FakeFfiContinuationMessageSender()) to LinkDesktopStep.WaitingForAuth("aVerificationUri"), GrantQrLoginProgress.EstablishingSecureChannel(1.toUByte(), "1") to LinkDesktopStep.EstablishingSecureChannel(1.toUByte(), "1"), diff --git a/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/linknewdevice/RustLinkMobileHandlerTest.kt b/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/linknewdevice/RustLinkMobileHandlerTest.kt index 3d84e34f45..8c0306c8ad 100644 --- a/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/linknewdevice/RustLinkMobileHandlerTest.kt +++ b/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/linknewdevice/RustLinkMobileHandlerTest.kt @@ -14,6 +14,7 @@ import com.google.common.truth.Truth.assertThat import io.element.android.libraries.matrix.api.linknewdevice.ErrorType import io.element.android.libraries.matrix.api.linknewdevice.LinkMobileStep import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiCheckCodeSender +import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiContinuationMessageSender import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiGrantLoginWithQrCodeHandler import io.element.android.libraries.matrix.impl.fixtures.fakes.FakeFfiQrCodeData import io.element.android.libraries.matrix.test.QR_CODE_DATA_RECIPROCATE @@ -52,7 +53,7 @@ class RustLinkMobileHandlerTest { listOf( GrantGeneratedQrLoginProgress.Starting to LinkMobileStep.Starting::class.java, GrantGeneratedQrLoginProgress.SyncingSecrets to LinkMobileStep.SyncingSecrets::class.java, - GrantGeneratedQrLoginProgress.WaitingForAuth("aVerificationUri") + GrantGeneratedQrLoginProgress.WaitingForAuth("aVerificationUri", FakeFfiContinuationMessageSender()) to LinkMobileStep.WaitingForAuth::class.java, GrantGeneratedQrLoginProgress.QrScanned(FakeFfiCheckCodeSender()) to LinkMobileStep.QrScanned::class.java, From 8b970fb2f14fd0e1f2420cc2fb49eb95c789fce5 Mon Sep 17 00:00:00 2001 From: ganfra Date: Wed, 29 Jul 2026 01:02:03 +0200 Subject: [PATCH 4/4] Fix license header on FakeFfiContinuationMessageSender --- .../impl/fixtures/fakes/FakeFfiContinuationMessageSender.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/fixtures/fakes/FakeFfiContinuationMessageSender.kt b/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/fixtures/fakes/FakeFfiContinuationMessageSender.kt index 7c504003f0..4f5358658f 100644 --- a/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/fixtures/fakes/FakeFfiContinuationMessageSender.kt +++ b/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/fixtures/fakes/FakeFfiContinuationMessageSender.kt @@ -1,7 +1,8 @@ /* - * Copyright (c) 2025 Element Creations Ltd. + * Copyright (c) 2026 Element Creations Ltd. * * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial. + * Please see LICENSE files in the repository root for full details. */ package io.element.android.libraries.matrix.impl.fixtures.fakes