From 0d27477c4d043a2516074ada57bc29095b2cd8b6 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 2 Jun 2026 23:43:12 +0000 Subject: [PATCH] fix: mark a DM conversation done when its last relays stop making progress MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After the connect-grace fix the convo history no longer hangs, but it could linger forever showing 'N relays' with no progress bar and exhausted=false: a correspondent's auth-walled relay (ditto, which only ever CLOSEs 'all authors must be authenticated') never reaches the pager's done/given-up state, and the no-progress guard merely *skipped* re-issuing the round — stopping the loop without ever reflecting that we're finished. When the guard trips (same active relays, zero events two rounds running) give up on those relays and recompute exhaustion, so the conversation reports as fully loaded and the relay count clears. My own reachable relays empty-EOSE to 'done' and never reach this branch, so only genuinely stuck correspondent relays are dropped. https://claude.ai/code/session_01B1fmmmX8JjQWH3amMLdvcW --- .../datasource/ChatroomNip04HistorySubAssembler.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/privateDM/datasource/ChatroomNip04HistorySubAssembler.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/privateDM/datasource/ChatroomNip04HistorySubAssembler.kt index 981a5b7e03..1bb665f986 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/privateDM/datasource/ChatroomNip04HistorySubAssembler.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/privateDM/datasource/ChatroomNip04HistorySubAssembler.kt @@ -159,7 +159,14 @@ class ChatroomNip04HistorySubAssembler( return } if (activeUnion == lastAskedActive && lastRoundEventCount == 0) { - Log.d("DMPagination") { "[convo.nip04.history] loadMore skipped — no progress on the same relays" } + // The same relays just returned nothing two rounds running — they're unreadable: a + // correspondent's auth-walled relay that only ever CLOSEs (ditto: "all authors must be + // authenticated"), or one perpetually stuck reconnecting. Give up on them so the + // conversation reports as finished instead of lingering forever on a "N relays" count + // with no progress bar. (My own reachable relays empty-EOSE to `done` and never land here.) + Log.d("DMPagination") { "[convo.nip04.history] giving up — no progress on the same relays ${activeUnion.map { it.url }}" } + perKeyActive.forEach { (pk, active) -> active.forEach { pager.giveUp(pk, it) } } + markExhaustedIfAllDone() return } lastAskedActive = activeUnion