From 149dedcc03000a1cb57ef5d47d16ea7bd7d0f3ee Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 12 Oct 2026 14:33:16 +0200 Subject: [PATCH] Store the user profile off the main thread when it is updated by the SDK Same issue as when refreshing the profile manually: the profile listener stored the profile (Base64 encoding and session database access) from the session coroutine scope, which runs on the main thread. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../element/android/libraries/matrix/impl/RustMatrixClient.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClient.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClient.kt index a9eb22cc8b..a30d63111a 100644 --- a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClient.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClient.kt @@ -322,7 +322,7 @@ class RustMatrixClient( override fun onUpdate(profile: UserProfile) { val matrixUser = profile.map() _userProfile.tryEmit(matrixUser) - sessionCoroutineScope.launch { + sessionCoroutineScope.launch(sessionDispatcher) { storeUserProfile(matrixUser) } }