Network Connection Logic Enhancement

Nucleic-Session: 93A70648-2057-4092-9372-860E1BA151D8
Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
2026-07-06 13:36:37 -07:00
co-authored by Nucleic
parent f1385adc72
commit 475447d103
@@ -773,6 +773,10 @@ final class HostConnection {
reconnect(to: host) reconnect(to: host)
return return
} }
// Already live — but if we're on a fallback transport and a LAN path exists now, try to move
// back to the direct connection (foregrounding on the Mac's Wi-Fi after being away on cellular,
// where no path-change event fired while suspended).
maybeUpgradeToLAN()
revalidateTask?.cancel() revalidateTask?.cancel()
revalidateTask = Task { [weak self] in revalidateTask = Task { [weak self] in
// A generous bound on a pong round-trip (LAN <10ms, relay <200ms) — only paid in full // A generous bound on a pong round-trip (LAN <10ms, relay <200ms) — only paid in full