Do not override the value of url returned by the SDK

This commit is contained in:
Benoit Marty
2025-11-06 12:29:08 +01:00
parent 6d252c0b20
commit 786d6f5642

View File

@@ -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<MatrixHomeServerDetails?>(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 ->