Upgrade SDK version to 25.02.26 (#4305)

* Upgrade SDK version to 25.02.26

* Remove OIDC URL result from logout, the SDK no longer provides it

* Handle room creation and destruction in a better way

* Remove `onSuccessLogout`
This commit is contained in:
Jorge Martin Espinosa 2025-02-26 10:04:49 +01:00 committed by GitHub
parent 3c30bec1c2
commit 274d9dc7c1
40 changed files with 46 additions and 230 deletions

View file

@ -84,12 +84,11 @@ interface MatrixClient : Closeable {
/**
* Logout the user.
* Returns an optional URL. When the URL is there, it should be presented to the user after logout for
* Relying Party (RP) initiated logout on their account page.
*
* @param userInitiated if false, the logout came from the HS, no request will be made and the session entry will be kept in the store.
* @param ignoreSdkError if true, the SDK will ignore any error and delete the session data anyway.
*/
suspend fun logout(userInitiated: Boolean, ignoreSdkError: Boolean): String?
suspend fun logout(userInitiated: Boolean, ignoreSdkError: Boolean)
/**
* Retrieve the user profile, will also eventually emit a new value to [userProfile].

View file

@ -493,8 +493,7 @@ class RustMatrixClient(
deleteSessionDirectory(deleteCryptoDb = false)
}
override suspend fun logout(userInitiated: Boolean, ignoreSdkError: Boolean): String? {
var result: String? = null
override suspend fun logout(userInitiated: Boolean, ignoreSdkError: Boolean) {
sessionCoroutineScope.cancel()
// Remove current delegate so we don't receive an auth error
clientDelegateTaskHandle?.cancelAndDestroy()
@ -502,7 +501,7 @@ class RustMatrixClient(
withContext(sessionDispatcher) {
if (userInitiated) {
try {
result = innerClient.logout()
innerClient.logout()
} catch (failure: Throwable) {
if (ignoreSdkError) {
Timber.e(failure, "Fail to call logout on HS. Still delete local files.")
@ -521,7 +520,6 @@ class RustMatrixClient(
sessionStore.removeSession(sessionId.value)
}
}
return result
}
override fun canDeactivateAccount(): Boolean {

View file

@ -122,9 +122,7 @@ class FakeMatrixClient(
var getRoomSummaryFlowLambda = { _: RoomIdOrAlias ->
flowOf<Optional<RoomSummary>>(Optional.empty())
}
var logoutLambda: (Boolean, Boolean) -> String? = { _, _ ->
null
}
var logoutLambda: (Boolean, Boolean) -> Unit = { _, _ -> }
override suspend fun getRoom(roomId: RoomId): MatrixRoom? {
return getRoomResults[roomId]
@ -174,8 +172,8 @@ class FakeMatrixClient(
clearCacheLambda()
}
override suspend fun logout(userInitiated: Boolean, ignoreSdkError: Boolean): String? = simulateLongTask {
return logoutLambda(ignoreSdkError, userInitiated)
override suspend fun logout(userInitiated: Boolean, ignoreSdkError: Boolean) = simulateLongTask {
logoutLambda(ignoreSdkError, userInitiated)
}
override fun canDeactivateAccount() = canDeactivateAccountResult()