mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-11 08:47:33 +00:00
feat(dm): log a 'window settled' line when every relay is done or stalled
The demand-driven rewrite dropped the round model's 'load done: all relays' completion line, leaving no aggregate signal for 'this is as far as history goes right now'. Log one per protocol on the exhausted false->true edge, with the done vs stalled relay breakdown, restoring that diagnostic.
This commit is contained in:
+6
@@ -217,7 +217,13 @@ class AccountGiftWrapsHistoryEoseManager(
|
||||
val stalled = stalledRelays[user.pubkeyHex] ?: emptySet()
|
||||
val pending = relays.any { !pager.isDone(user.pubkeyHex, it) && it !in stalled }
|
||||
val ex = !pending
|
||||
val was = exhaustedByUser[user.pubkeyHex] ?: false
|
||||
exhaustedByUser[user.pubkeyHex] = ex
|
||||
if (ex && !was) {
|
||||
val done = relays.filter { pager.isDone(user.pubkeyHex, it) }.map { it.url }
|
||||
val stuck = relays.filter { it in stalled && !pager.isDone(user.pubkeyHex, it) }.map { it.url }
|
||||
Log.d(TAG) { "[giftwrap.history] window settled (nothing more reachable) — done=$done stalled=$stuck" }
|
||||
}
|
||||
if (activeUser == user.pubkeyHex) _exhausted.value = ex
|
||||
}
|
||||
|
||||
|
||||
+6
@@ -207,7 +207,13 @@ class ChatroomNip04HistorySubAssembler(
|
||||
val stalled = stalledRelays[pk] ?: emptySet()
|
||||
val pending = relays.all.any { !pager.isDone(pk, it) && it !in stalled }
|
||||
val ex = !pending
|
||||
val was = exhaustedByConvo[pk] ?: false
|
||||
exhaustedByConvo[pk] = ex
|
||||
if (ex && !was) {
|
||||
val done = relays.all.filter { pager.isDone(pk, it) }.map { it.url }
|
||||
val stuck = relays.all.filter { it in stalled && !pager.isDone(pk, it) }.map { it.url }
|
||||
Log.d("DMPagination") { "[convo.nip04.history] window settled (nothing more reachable) — done=$done stalled=$stuck" }
|
||||
}
|
||||
if (activeConvo == pk) _exhausted.value = ex
|
||||
}
|
||||
|
||||
|
||||
+6
@@ -193,7 +193,13 @@ class ChatroomListNip04HistorySubAssembler(
|
||||
val stalled = stalledRelays[user.pubkeyHex] ?: emptySet()
|
||||
val pending = relays.any { !pager.isDone(user.pubkeyHex, it) && it !in stalled }
|
||||
val ex = !pending
|
||||
val was = exhaustedByUser[user.pubkeyHex] ?: false
|
||||
exhaustedByUser[user.pubkeyHex] = ex
|
||||
if (ex && !was) {
|
||||
val done = relays.filter { pager.isDone(user.pubkeyHex, it) }.map { it.url }
|
||||
val stuck = relays.filter { it in stalled && !pager.isDone(user.pubkeyHex, it) }.map { it.url }
|
||||
Log.d("DMPagination") { "[rooms.nip04.history] window settled (nothing more reachable) — done=$done stalled=$stuck" }
|
||||
}
|
||||
if (activeUser == user.pubkeyHex) _exhausted.value = ex
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user