From 2d77a1b10b75e9bf88ec44d0029d078fae12ef89 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Wed, 5 Mar 2025 16:29:48 +0200 Subject: [PATCH] Prevent various room subscription task from blocking opening rooms - this came from having seen the opening room modal show up too often which was caused by `isEncrypted` being block_on on the rust side and sometimes making network requests - we aggreed that the `block_on`s should go, which is handled in https://github.com/matrix-org/matrix-rust-sdk/pull/4756 and https://github.com/matrix-org/matrix-rust-sdk/pull/4757 --- .../Services/Room/JoinedRoomProxy.swift | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ElementX/Sources/Services/Room/JoinedRoomProxy.swift b/ElementX/Sources/Services/Room/JoinedRoomProxy.swift index 7677e2d0a..dd4ce7ce5 100644 --- a/ElementX/Sources/Services/Room/JoinedRoomProxy.swift +++ b/ElementX/Sources/Services/Room/JoinedRoomProxy.swift @@ -135,15 +135,17 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol { await timeline.subscribeForUpdates() - subscribeToRoomInfoUpdates() - - if isEncrypted { - subscribeToIdentityStatusChanges() + Task { + subscribeToRoomInfoUpdates() + + subscribeToTypingNotifications() + + await subscribeToKnockRequests() + + if isEncrypted { // This is actually blocking on the rust side and might make network requests + subscribeToIdentityStatusChanges() + } } - - subscribeToTypingNotifications() - - await subscribeToKnockRequests() } func subscribeToRoomInfoUpdates() {