From ce4028ffc85ad897c44b21c095b0d3b9d33f04f4 Mon Sep 17 00:00:00 2001 From: Andrew Blakeslee Moore Date: Sat, 4 Jul 2026 23:39:26 -0700 Subject: [PATCH] Network Type Transition Optimization Nucleic-Session: 40F8C53A-F001-423A-8607-EAE181DBE14B Co-authored-by: Nucleic --- NucleicRemote/NucleicRemote/Models/HostConnection.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NucleicRemote/NucleicRemote/Models/HostConnection.swift b/NucleicRemote/NucleicRemote/Models/HostConnection.swift index a5f83cd..893e7d0 100644 --- a/NucleicRemote/NucleicRemote/Models/HostConnection.swift +++ b/NucleicRemote/NucleicRemote/Models/HostConnection.swift @@ -180,7 +180,11 @@ final class HostConnection { relay: (membershipToken: String?, url: String?)? = nil ) -> [TransportAttempt] { var candidates: [TransportAttempt] = [] - if let endpoint = discovery.endpoint(forFingerprint: fingerprint, lanHost: lanHost, lanPort: lanPort) { + // Only offer LAN when the device actually has a LAN-capable path (Wi-Fi/wired). On cellular + // the pinned `lanHost:lanPort` is unreachable, so including it here would just burn the + // connect timeout before falling through — skip it and dial tailnet/relay immediately. + if pathMonitor.canUseLAN, + let endpoint = discovery.endpoint(forFingerprint: fingerprint, lanHost: lanHost, lanPort: lanPort) { candidates.append(.lan(endpoint)) } if let tailnet, let host = tailnet.host, let port = tailnet.port, TailnetSupport.isBuiltIn {