mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-11 16:57:39 +00:00
fix: mark a DM conversation done when its last relays stop making progress
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
This commit is contained in:
+8
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user