Reconnect: time out a stuck login, close failed attempts, log why #145

Merged
littlefox merged 1 commit from issue-109-reconnect-stall into main 2026-10-19 08:41:49 +00:00
Owner

Closes #109

Builds on #142 (it uses the relay-refusal error), so it includes that commit.

  • Each reconnect attempt now has 20 s to log in and start once connected; before, only connecting had a timeout.
  • A failed or timed-out attempt closes its connection. Before, every failed attempt left one open at the relay, against the per-address limit.
  • Each failure is written to the events list as 'Återanslutningen misslyckades: …'.

The stall in #109 can't be reproduced, so I can't say for sure which of these caused it. The new logging will show it if it happens again.

Verified: a new reconnect.spec test where the first attempt gets the greeting and then hangs: given up after 20 s, socket closed, reason logged, next attempt succeeds. reconnect, soak (60 s, 16 drops) and relay specs pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8

Closes #109 Builds on #142 (it uses the relay-refusal error), so it includes that commit. - Each reconnect attempt now has 20 s to log in and start once connected; before, only connecting had a timeout. - A failed or timed-out attempt closes its connection. Before, every failed attempt left one open at the relay, against the per-address limit. - Each failure is written to the events list as 'Återanslutningen misslyckades: …'. The stall in #109 can't be reproduced, so I can't say for sure which of these caused it. The new logging will show it if it happens again. Verified: a new reconnect.spec test where the first attempt gets the greeting and then hangs: given up after 20 s, socket closed, reason logged, next attempt succeeds. reconnect, soak (60 s, 16 drops) and relay specs pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
Say why when the relay refuses the connection
All checks were successful
ci / check (push) Successful in 10m40s
ci / desktop (push) Successful in 16m19s
ci / e2e (push) Successful in 29m51s
b4f2474819
A browser only sees 'connection failed' for a refused WebSocket
handshake, so a full relay or a disallowed page showed 'Kunde inte nå
servern, kontrollera adressen', which sent people looking in the wrong
place. The relay now accepts such connections and closes them at once
with a code (4004 full for this address, 4005 full, 4006 origin not
allowed), and the login says what happened.

Refs #133

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
Reconnect: time out a stuck login, close failed attempts, log why
All checks were successful
ci / check (push) Successful in 9m44s
ci / desktop (push) Successful in 15m46s
ci / e2e (push) Successful in 26m10s
9a356b869f
An attempt that connected but then stopped answering waited forever in
login or Kom::start; only the connect step had a timeout. Give the rest
20 s too. A failed attempt also left its connection open, and those
piled up at the relay's per-address limit, which could make the next
attempts fail as well. Each failure now goes to the events list, so a
slow reconnect can be told from a stuck one.

Refs #109

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
littlefox referenced this pull request from a commit 2026-10-19 21:34:00 +00:00
Sign in to join this conversation.
No description provided.