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) <noreply@anthropic.com>
This commit is contained in:
Benoit Marty
2026-10-12 14:33:16 +02:00
parent 404c26c62e
commit 149dedcc03
@@ -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)
}
}