fix: give up on unreachable relays so the rooms list resolves

Follow-up to the no-progress retry: in this trace vitor/mom/nos.lol never
connect at all (only damus gets a REQ — the other three cannot-connect
for both live and history). The retry correctly re-attempts, but it can't
reach relays that won't connect, so every round is 0 events, no relay is
ever 'done', exhausted never completes, and it retries forever — a cold,
empty feed stays on the spinner.

The round-model history had no give-up for repeated cannot-connect (only
for CLOSE), unlike the convo path. Route onCannotConnect through the same
pager give-up as onClosed, so a relay that's unreachable for a few rounds
is abandoned, exhaustion completes, and the screen resolves (to the
loaded rooms, or empty + retry) instead of spinning forever. The streak
resets on any contact, so a merely slow relay that connects within a few
attempts isn't dropped. Applied to both round-model managers.

https://claude.ai/code/session_01B1fmmmX8JjQWH3amMLdvcW
This commit is contained in:
Claude
2026-06-03 21:52:38 +00:00
parent a3b4df8e6e
commit edbdbdcc8e
2 changed files with 9 additions and 0 deletions
@@ -328,7 +328,12 @@ class AccountGiftWrapsHistoryEoseManager(
message: String,
forFilters: List<Filter>?,
) {
// Cannot-connect is also "no answer": count it toward give-up like a CLOSE, so a relay
// that's unreachable (down / blocked) doesn't keep exhaustion false forever — otherwise a
// cold, empty feed would retry it endlessly and stay on the spinner. Once it's given up,
// exhaustion can complete and the screen resolves (to the loaded rooms, or empty + retry).
windowLoad.onRelaySettled(relay)
if (pager.onClosed(user.pubkeyHex, relay)) markExhaustedIfAllDone(user)
}
}
@@ -282,7 +282,11 @@ class ChatroomListNip04HistorySubAssembler(
message: String,
forFilters: List<Filter>?,
) {
// Count cannot-connect toward give-up like a CLOSE, so an unreachable relay doesn't keep
// exhaustion false forever (otherwise a cold, empty feed retries it endlessly and stays on
// the spinner). Once given up, exhaustion completes and the screen resolves.
windowLoad.onRelaySettled(relay)
if (pager.onClosed(user.pubkeyHex, relay)) markExhaustedIfAllDone(user)
}
}