Merge pull request #5796 from element-hq/renovate/org.matrix.rustcomponents-sdk-android-25.x

fix(deps): update dependency org.matrix.rustcomponents:sdk-android to v25.11.24
This commit is contained in:
ganfra 2025-11-25 11:36:16 +01:00 committed by GitHub
commit 4168deb6b7
6 changed files with 10 additions and 21 deletions

View file

@ -179,7 +179,7 @@ class RoomMemberListPresenter(
return if (room.info().isEncrypted != true) { return if (room.info().isEncrypted != true) {
RoomMemberWithIdentityState(this, null) RoomMemberWithIdentityState(this, null)
} else { } else {
val identityState = identityStates[userId] ?: encryptionService.getUserIdentity(userId).getOrNull() val identityState = identityStates[userId] ?: encryptionService.getUserIdentity(userId, fallbackToServer = false).getOrNull()
RoomMemberWithIdentityState(this, identityState) RoomMemberWithIdentityState(this, identityState)
} }
} }

View file

@ -386,14 +386,12 @@ class UserProfilePresenterTest {
} }
private fun createFakeMatrixClient( private fun createFakeMatrixClient(
isUserVerified: Boolean = true,
userIdentityState: IdentityState? = null, userIdentityState: IdentityState? = null,
ignoreUserResult: (UserId) -> Result<Unit> = { Result.success(Unit) }, ignoreUserResult: (UserId) -> Result<Unit> = { Result.success(Unit) },
unIgnoreUserResult: (UserId) -> Result<Unit> = { Result.success(Unit) }, unIgnoreUserResult: (UserId) -> Result<Unit> = { Result.success(Unit) },
ignoredUsersFlow: StateFlow<ImmutableList<UserId>> = MutableStateFlow(persistentListOf()) ignoredUsersFlow: StateFlow<ImmutableList<UserId>> = MutableStateFlow(persistentListOf())
) = FakeMatrixClient( ) = FakeMatrixClient(
encryptionService = FakeEncryptionService( encryptionService = FakeEncryptionService(
isUserVerifiedResult = { Result.success(isUserVerified) },
getUserIdentityResult = { Result.success(userIdentityState) } getUserIdentityResult = { Result.success(userIdentityState) }
), ),
ignoreUserResult = ignoreUserResult, ignoreUserResult = ignoreUserResult,

View file

@ -178,7 +178,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 # 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 # 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. # only fix API breaks and may add some TODOs.
matrix_sdk = "org.matrix.rustcomponents:sdk-android:25.11.19" matrix_sdk = "org.matrix.rustcomponents:sdk-android:25.11.24"
# Others # Others
coil = { module = "io.coil-kt.coil3:coil", version.ref = "coil" } coil = { module = "io.coil-kt.coil3:coil", version.ref = "coil" }

View file

@ -64,8 +64,6 @@ interface EncryptionService {
*/ */
suspend fun startIdentityReset(): Result<IdentityResetHandle?> suspend fun startIdentityReset(): Result<IdentityResetHandle?>
suspend fun isUserVerified(userId: UserId): Result<Boolean>
/** /**
* Remember this identity, ensuring it does not result in a pin violation. * Remember this identity, ensuring it does not result in a pin violation.
*/ */
@ -82,8 +80,10 @@ interface EncryptionService {
/** /**
* Get the identity state of a user, if known. * Get the identity state of a user, if known.
* @param userId the user id to get the identity for.
* @param fallbackToServer whether to fallback to fetching the identity from the server if not known locally. Defaults to true.
*/ */
suspend fun getUserIdentity(userId: UserId): Result<IdentityState?> suspend fun getUserIdentity(userId: UserId, fallbackToServer: Boolean = true): Result<IdentityState?>
} }
/** /**

View file

@ -240,10 +240,6 @@ class RustEncryptionService(
} }
} }
override suspend fun isUserVerified(userId: UserId): Result<Boolean> = runCatchingExceptions {
getUserIdentityInternal(userId).isVerified()
}
override suspend fun pinUserIdentity(userId: UserId): Result<Unit> = runCatchingExceptions { override suspend fun pinUserIdentity(userId: UserId): Result<Unit> = runCatchingExceptions {
getUserIdentityInternal(userId).pin() getUserIdentityInternal(userId).pin()
} }
@ -252,8 +248,8 @@ class RustEncryptionService(
getUserIdentityInternal(userId).withdrawVerification() getUserIdentityInternal(userId).withdrawVerification()
} }
override suspend fun getUserIdentity(userId: UserId): Result<IdentityState?> = runCatchingExceptions { override suspend fun getUserIdentity(userId: UserId, fallbackToServer: Boolean): Result<IdentityState?> = runCatchingExceptions {
val identity = getUserIdentityInternal(userId) val identity = getUserIdentityInternal(userId, fallbackToServer)
val isVerified = identity.isVerified() val isVerified = identity.isVerified()
when { when {
identity.hasVerificationViolation() -> IdentityState.VerificationViolation identity.hasVerificationViolation() -> IdentityState.VerificationViolation
@ -263,10 +259,10 @@ class RustEncryptionService(
} }
} }
suspend fun getUserIdentityInternal(userId: UserId): UserIdentity { private suspend fun getUserIdentityInternal(userId: UserId, fallbackToServer: Boolean = true): UserIdentity {
return service.userIdentity( return service.userIdentity(
userId = userId.value, userId = userId.value,
// requestFromHomeserverIfNeeded = true, fallbackToServer = fallbackToServer,
) ?: error("User identity not found") ) ?: error("User identity not found")
} }

View file

@ -26,7 +26,6 @@ import kotlinx.coroutines.flow.flowOf
class FakeEncryptionService( class FakeEncryptionService(
var startIdentityResetLambda: () -> Result<IdentityResetHandle?> = { lambdaError() }, var startIdentityResetLambda: () -> Result<IdentityResetHandle?> = { lambdaError() },
private val pinUserIdentityResult: (UserId) -> Result<Unit> = { lambdaError() }, private val pinUserIdentityResult: (UserId) -> Result<Unit> = { lambdaError() },
private val isUserVerifiedResult: (UserId) -> Result<Boolean> = { lambdaError() },
private val withdrawVerificationResult: (UserId) -> Result<Unit> = { lambdaError() }, private val withdrawVerificationResult: (UserId) -> Result<Unit> = { lambdaError() },
private val getUserIdentityResult: (UserId) -> Result<IdentityState?> = { lambdaError() }, private val getUserIdentityResult: (UserId) -> Result<IdentityState?> = { lambdaError() },
private val enableRecoveryLambda: (Boolean) -> Result<Unit> = { lambdaError() }, private val enableRecoveryLambda: (Boolean) -> Result<Unit> = { lambdaError() },
@ -139,11 +138,7 @@ class FakeEncryptionService(
return withdrawVerificationResult(userId) return withdrawVerificationResult(userId)
} }
override suspend fun isUserVerified(userId: UserId): Result<Boolean> = simulateLongTask { override suspend fun getUserIdentity(userId: UserId, fallbackToServer: Boolean): Result<IdentityState?> = simulateLongTask {
isUserVerifiedResult(userId)
}
override suspend fun getUserIdentity(userId: UserId): Result<IdentityState?> = simulateLongTask {
return getUserIdentityResult(userId) return getUserIdentityResult(userId)
} }