From 79243c8fcad449fd630b2195c471495118489b12 Mon Sep 17 00:00:00 2001 From: jack Date: Tue, 22 Jul 2025 16:53:33 +0200 Subject: [PATCH] Reduce notification timing for better UX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Network empty reset delay: 5 min → 1 min - Notification cooldown: 10 min → 5 min - More responsive when peers drop and rejoin - Still prevents spam from flaky connections --- bitchat/Services/BluetoothMeshService.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitchat/Services/BluetoothMeshService.swift b/bitchat/Services/BluetoothMeshService.swift index 07ec4351..f25b4840 100644 --- a/bitchat/Services/BluetoothMeshService.swift +++ b/bitchat/Services/BluetoothMeshService.swift @@ -84,8 +84,8 @@ class BluetoothMeshService: NSObject { private var hasNotifiedNetworkAvailable = false // Track if we've notified about network availability private var lastNetworkNotificationTime: Date? // Track when we last sent a network notification private var networkBecameEmptyTime: Date? // Track when the network became empty - private let networkNotificationCooldown: TimeInterval = 600 // 10 minutes between notifications - private let networkEmptyResetDelay: TimeInterval = 300 // 5 minutes before resetting notification flag + private let networkNotificationCooldown: TimeInterval = 300 // 5 minutes between notifications + private let networkEmptyResetDelay: TimeInterval = 60 // 1 minute before resetting notification flag private var intentionalDisconnects = Set() // Track peripherals we're disconnecting intentionally private var peerLastSeenTimestamps = LRUCache(maxSize: 100) // Bounded cache for peer timestamps private var cleanupTimer: Timer? // Timer to clean up stale peers