Files
paseo/packages
Mohamed Boudra 03adc4d4ba Keep working host connections from flapping on busy heartbeats and back off background probes (#10395)
* fix(app): stop busy-heartbeat adaptive switches and back off online probes

Hosts with multiple saved connections still replaced healthy relay links
during active use: every 120 seconds the runtime compared an idle alternate
probe against the single latest heartbeat RTT on the busy active socket
using a fixed 40 ms threshold, then tore down the live socket before
connecting the replacement (leaving the host in connecting for ~2 s).

Use the 60-second rolling minimum of active heartbeats as the baseline,
require at least max(40 ms, 35% of baseline RTT) improvement to switch,
exponentially back off inactive online probes from 2m to 30m while the
active connection keeps winning (resetting on candidate win, reconnect,
connection list changes, or foreground verify), and connect the replacement
before disposing the live client on adaptive switches.

Closes #9149

* fix(app): preserve active listener, recheck candidate, and refresh caches on make-before-break upgrade

Keep installed active-client status listeners bound to `this.activeClient`
rather than `switchRequestVersion` so a pending or failed speculative
upgrade never mutes disconnect events on the active socket. Recheck that
the target connection still exists and matches before and after disposing
the old client so removing or editing an endpoint during handshake aborts
the upgrade. Track the last online `connectionEpoch` in `HostRuntimeStore`
so make-before-break upgrades that stay `online` still trigger reconnect
cache invalidation and history sync generation bumps.
2026-11-22 11:27:27 +07:00
..