Remove MatrixAuthenticationService.getLatestSessionId()

This commit is contained in:
Benoit Marty 2025-09-18 15:31:07 +02:00 committed by Benoit Marty
parent 04835efe96
commit 37d036cb12
3 changed files with 0 additions and 10 deletions

View file

@ -16,8 +16,6 @@ import io.element.android.libraries.matrix.api.core.SessionId
import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.StateFlow
interface MatrixAuthenticationService { interface MatrixAuthenticationService {
suspend fun getLatestSessionId(): SessionId?
/** /**
* Restore a session from a [sessionId]. * Restore a session from a [sessionId].
* Do not restore anything it the access token is not valid anymore. * Do not restore anything it the access token is not valid anymore.

View file

@ -81,10 +81,6 @@ class RustMatrixAuthenticationService(
.also { sessionPaths = it } .also { sessionPaths = it }
} }
override suspend fun getLatestSessionId(): SessionId? = withContext(coroutineDispatchers.io) {
sessionStore.getLatestSession()?.userId?.let { SessionId(it) }
}
override suspend fun restoreSession(sessionId: SessionId): Result<MatrixClient> = withContext(coroutineDispatchers.io) { override suspend fun restoreSession(sessionId: SessionId): Result<MatrixClient> = withContext(coroutineDispatchers.io) {
runCatchingExceptions { runCatchingExceptions {
val sessionData = sessionStore.getSession(sessionId.value) val sessionData = sessionStore.getSession(sessionId.value)

View file

@ -41,10 +41,6 @@ class FakeMatrixAuthenticationService(
private var matrixClient: MatrixClient? = null private var matrixClient: MatrixClient? = null
private var onAuthenticationListener: ((MatrixClient) -> Unit)? = null private var onAuthenticationListener: ((MatrixClient) -> Unit)? = null
var getLatestSessionIdLambda: (() -> SessionId?) = { null }
override suspend fun getLatestSessionId(): SessionId? = getLatestSessionIdLambda()
override suspend fun restoreSession(sessionId: SessionId): Result<MatrixClient> { override suspend fun restoreSession(sessionId: SessionId): Result<MatrixClient> {
matrixClientResult?.let { matrixClientResult?.let {
return it.invoke(sessionId) return it.invoke(sessionId)