From f7b4fb815bc1cdd96eb6840dda475be28c333d1f Mon Sep 17 00:00:00 2001 From: jack Date: Tue, 22 Jul 2025 16:50:25 +0200 Subject: [PATCH] Fix compilation error and add peer tracking logs - Remove reference to undefined wasInserted variable - Add proper logging after wasInserted is defined - Track when peers are added vs already present --- bitchat/Services/BluetoothMeshService.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bitchat/Services/BluetoothMeshService.swift b/bitchat/Services/BluetoothMeshService.swift index 2db27492..07ec4351 100644 --- a/bitchat/Services/BluetoothMeshService.swift +++ b/bitchat/Services/BluetoothMeshService.swift @@ -1978,7 +1978,7 @@ class BluetoothMeshService: NSObject { // Check if we've already announced this peer let isFirstAnnounce = !announcedPeers.contains(senderID) - print("📱 Peer announce: \(senderID), isFirstAnnounce: \(isFirstAnnounce), wasInserted: \(wasInserted ?? false)") + print("📱 Peer announce: \(senderID), isFirstAnnounce: \(isFirstAnnounce)") // Clean up stale peer IDs with the same nickname collectionsQueue.sync(flags: .barrier) { @@ -2103,7 +2103,9 @@ class BluetoothMeshService: NSObject { return result } if wasInserted { - // Added peer \(senderID) (\(nickname)) to active peers + print("📱 Added peer \(senderID) (\(nickname)) to active peers") + } else { + print("📱 Peer \(senderID) already in active peers") } // Show join message only for first announce AND if we actually added the peer