mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 08:27:04 +00:00
Measured over the real OkHttp transport (upstream killed mid-mirror and restarted on the same port): NostrClient re-dials once on disconnect and then falls back to its 60s keep-alive, which showed up as a 61s mirror blackout when the immediate re-dial raced the port rebind. - Retry pump: the worker nudges the pool every 5s. Cheap and safe — reconnectIfNeedsTo skips connected relays and each relay's exponential backoff (1s doubling, 5min cap) still gates real dial attempts, so dead upstreams aren't hammered. Restart recovery drops from 61s to ~6s in the new reconnect test. - WebSocket pings (120s, same as the Android relay pool): without them a half-open connection (network drop, no FIN) never fires onDisconnected and the mirror would stall silently forever. - MirrorWorkerReconnectTest: end-to-end over a real Ktor port — ride through the drop, re-subscribe, drop the duplicate replay, pull the event that only exists on the new instance. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TtDNpayEYvJH7QuPswND3A