From 1e40dec468c7130fc29ec6112626aab72f0c9ef6 Mon Sep 17 00:00:00 2001 From: Siavash Sameni Date: Tue, 7 Apr 2026 10:13:51 +0400 Subject: [PATCH] feat: periodic server ping every 5s while app is open Co-Authored-By: Claude Opus 4.6 (1M context) --- android/app/src/main/java/com/wzp/ui/call/InCallScreen.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/android/app/src/main/java/com/wzp/ui/call/InCallScreen.kt b/android/app/src/main/java/com/wzp/ui/call/InCallScreen.kt index 9df2453..17b5f69 100644 --- a/android/app/src/main/java/com/wzp/ui/call/InCallScreen.kt +++ b/android/app/src/main/java/com/wzp/ui/call/InCallScreen.kt @@ -90,10 +90,13 @@ fun InCallScreen( var showManageRelays by remember { mutableStateOf(false) } - // Ping servers on launch — engine init + QUIC ping, no restart needed + // Periodic ping every 5 seconds while app is open LaunchedEffect(Unit) { viewModel.loadSavedFingerprints() - viewModel.pingAllServers() + while (true) { + viewModel.pingAllServers() + kotlinx.coroutines.delay(5000) + } } Surface(