From 29dd5efa94dbff9efa69f18691b4139340d81c44 Mon Sep 17 00:00:00 2001 From: Narasimha-sc <166327228+Narasimha-sc@users.noreply.github.com> Date: Tue, 20 Oct 2026 15:31:38 +0000 Subject: [PATCH] desktop: check the network every 2 s while the core is offline --- .../kotlin/chat/simplex/common/helpers/NetworkObserver.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/helpers/NetworkObserver.kt b/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/helpers/NetworkObserver.kt index b5f0d08e04..90aa5d719f 100644 --- a/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/helpers/NetworkObserver.kt +++ b/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/helpers/NetworkObserver.kt @@ -41,7 +41,8 @@ class NetworkObserver { // the observer thread is not restarted until the chat controller is created anew Log.e(TAG, "Error observing network: ${e.stackTraceToString()}") } - sleepDetectingSuspend(POLL_INTERVAL_MS) + // the core holds sending while it is offline, so the network is checked more often then + sleepDetectingSuspend(if (sentInfo?.online == false) OFFLINE_POLL_INTERVAL_MS else POLL_INTERVAL_MS) } } @@ -133,6 +134,7 @@ class NetworkObserver { companion object { val shared = NetworkObserver() private const val POLL_INTERVAL_MS = 10_000L + private const val OFFLINE_POLL_INTERVAL_MS = 2_000L private const val CONFIRM_OFFLINE_MS = 1_000L private const val SUSPENDED_MS = 25_000L private const val NO_ROUTE = "no route"