fix: relay connectivity degradation with Tor by adding WebSocket pings, pool eviction, and reducing backoff

Dead WebSocket connections through Tor were going undetected because no
ping interval was set, leaving zombie connections that appeared connected
but carried no traffic. Additionally, relay error backoff was set to
ONE_DAY making recovery impossible without toggling Tor, and the shared
OkHttp connection pool retained stale connections across proxy changes.

- Add 120s WebSocket ping interval to detect dead Tor connections
- Reduce dontTryAgainForALongTime from ONE_DAY to FIVE_MINUTES
- Evict shared connection pool when proxy settings change

https://claude.ai/code/session_01VFAypytKGzdmuoJAXrb72G
This commit is contained in:
Claude
2026-04-11 02:03:23 +00:00
parent 9bf628b823
commit 8cc198d161
3 changed files with 15 additions and 1 deletions
@@ -228,7 +228,7 @@ open class BasicRelayClient(
}
fun dontTryAgainForALongTime() {
delayToConnectInSeconds = TimeUtils.ONE_DAY
delayToConnectInSeconds = TimeUtils.FIVE_MINUTES
}
override fun sendOrConnectAndSync(cmd: Command) {