From edbdbdcc8eccf97b3f5cf91f664ab172713d3d74 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 3 Jun 2026 21:52:38 +0000 Subject: [PATCH] fix: give up on unreachable relays so the rooms list resolves MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../nip59GiftWraps/AccountGiftWrapsHistoryEoseManager.kt | 5 +++++ .../rooms/datasource/ChatroomListNip04HistorySubAssembler.kt | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/account/nip59GiftWraps/AccountGiftWrapsHistoryEoseManager.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/account/nip59GiftWraps/AccountGiftWrapsHistoryEoseManager.kt index 7e3986b7b3..8734fe3d20 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/account/nip59GiftWraps/AccountGiftWrapsHistoryEoseManager.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/account/nip59GiftWraps/AccountGiftWrapsHistoryEoseManager.kt @@ -328,7 +328,12 @@ class AccountGiftWrapsHistoryEoseManager( message: String, forFilters: List?, ) { + // 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) } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/rooms/datasource/ChatroomListNip04HistorySubAssembler.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/rooms/datasource/ChatroomListNip04HistorySubAssembler.kt index ff75a86c90..adf9cae42b 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/rooms/datasource/ChatroomListNip04HistorySubAssembler.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/rooms/datasource/ChatroomListNip04HistorySubAssembler.kt @@ -282,7 +282,11 @@ class ChatroomListNip04HistorySubAssembler( message: String, forFilters: List?, ) { + // 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) } }