From 786d6f5642bd3878c2a5d24db9397f0754a2049c Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 6 Nov 2025 12:29:08 +0100 Subject: [PATCH] Do not override the value of url returned by the SDK --- .../matrix/impl/auth/RustMatrixAuthenticationService.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/auth/RustMatrixAuthenticationService.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/auth/RustMatrixAuthenticationService.kt index 7ed523812f..dc93b9aaf5 100644 --- a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/auth/RustMatrixAuthenticationService.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/auth/RustMatrixAuthenticationService.kt @@ -36,7 +36,6 @@ import io.element.android.libraries.matrix.impl.paths.SessionPathsFactory import io.element.android.libraries.sessionstorage.api.LoginType import io.element.android.libraries.sessionstorage.api.SessionStore import kotlinx.coroutines.CancellationException -import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.withContext import org.matrix.rustcomponents.sdk.Client import org.matrix.rustcomponents.sdk.ClientBuilder @@ -66,7 +65,6 @@ class RustMatrixAuthenticationService( // Ideally it would be possible to get the sessionPath from the Client to avoid doing this. private var sessionPaths: SessionPaths? = null private var currentClient: Client? = null - private var currentHomeserver = MutableStateFlow(null) private val newMatrixClientObservers = mutableListOf<(MatrixClient) -> Unit>() override fun listenToNewMatrixClients(lambda: (MatrixClient) -> Unit) { @@ -119,8 +117,7 @@ class RustMatrixAuthenticationService( } currentClient = client - val homeServerDetails = client.homeserverLoginDetails().map() - homeServerDetails.copy(url = homeserver) + client.homeserverLoginDetails().map() }.onFailure { clear() }.mapFailure { failure ->