From 9243763e05e04cff69fd54c42af9bc2d5165ca17 Mon Sep 17 00:00:00 2001 From: Andrew Blakeslee Moore Date: Sun, 5 Jul 2026 04:17:39 -0700 Subject: [PATCH] Reconnect Icon Update Nucleic-Session: 183CCBC5-8629-4480-A7A9-C981D551DCFD Co-authored-by: Nucleic --- .../NucleicRemote/Models/HostConnection.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/NucleicRemote/NucleicRemote/Models/HostConnection.swift b/NucleicRemote/NucleicRemote/Models/HostConnection.swift index 654ab5f..8436ad5 100644 --- a/NucleicRemote/NucleicRemote/Models/HostConnection.swift +++ b/NucleicRemote/NucleicRemote/Models/HostConnection.swift @@ -201,6 +201,18 @@ final class HostConnection { relayMembershipToken: nil, relayURL: nil) } + /// Whether the dialable endpoints of a gossiped record differ from the one on file — the + /// signal that a known Mac must be re-dialed (its LAN port, tailnet IP, or relay room moved). + /// Ignores relay *credentials* (token/URL), which `mergePairedHost` preserves and which don't + /// change where the Mac is reached. + private static func dialableAddressChanged(from existing: PairedHost, to incoming: PairedHost) -> Bool { + existing.lanHost != incoming.lanHost + || existing.lanPort != incoming.lanPort + || existing.tailnetHost != incoming.tailnetHost + || existing.tailnetPort != incoming.tailnetPort + || existing.relayRoomID != incoming.relayRoomID + } + /// Split a "host:port" hint (last-colon split so a bracketed IPv6 host survives). private static func splitHostPort(_ hint: String?) -> (String?, UInt16?) { guard let hint, let colon = hint.lastIndex(of: ":"),