From 14924a4546287c8be54133cab6247267648b75f4 Mon Sep 17 00:00:00 2001 From: Doug <6060466+pixlwave@users.noreply.github.com> Date: Mon, 28 Jul 2025 13:07:04 +0100 Subject: [PATCH] Add some logs to help debug waiting for rooms. (#4360) --- .../Sources/Services/Client/ClientProxy.swift | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/ElementX/Sources/Services/Client/ClientProxy.swift b/ElementX/Sources/Services/Client/ClientProxy.swift index abb481920..2b298e7f9 100644 --- a/ElementX/Sources/Services/Client/ClientProxy.swift +++ b/ElementX/Sources/Services/Client/ClientProxy.swift @@ -1021,11 +1021,23 @@ class ClientProxy: ClientProxyProtocol { } private func waitForRoomToSync(roomID: String, timeout: Duration = .seconds(10)) async { + MXLog.info("Wait for \(roomID)") let runner = ExpiringTaskRunner { [weak self] in - try await self?.client.awaitRoomRemoteEcho(roomId: roomID) + guard let self else { return } + + do { + _ = try await client.awaitRoomRemoteEcho(roomId: roomID) + MXLog.info("Wait for \(roomID) got remote echo.") + } catch { + MXLog.info("Failed waiting for remote echo in \(roomID): \(error)") + } } - _ = try? await runner.run(timeout: timeout) + do { + try await runner.run(timeout: timeout) + } catch { + MXLog.info("Wait for \(roomID) failed: \(error)") + } } private func updateIgnoredUsers() {