mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 16:33:27 +00:00
Merge pull request #3055 from vitorpamplona/claude/affectionate-wright-GRP8r
fix(user-metadata): fall back to indexer relays when outbox is exhausted
This commit is contained in:
+13
-2
@@ -56,9 +56,20 @@ fun filterUserMetadataForKey(
|
||||
val perRelayUsers =
|
||||
mapOfSet {
|
||||
authors.forEach { key ->
|
||||
val outbox = key.outboxRelays()
|
||||
val relays =
|
||||
key.outboxRelays()
|
||||
?: (key.allUsedRelays() + LocalCache.relayHints.hintsForKey(key.pubkeyHex) + indexRelays)
|
||||
when {
|
||||
outbox == null ->
|
||||
key.allUsedRelays() + LocalCache.relayHints.hintsForKey(key.pubkeyHex) + indexRelays
|
||||
// Outbox is published but exhausted (every relay either EOSE'd
|
||||
// or is known-unreachable) and metadata is still missing —
|
||||
// widen to indexers so a misconfigured outbox doesn't strand
|
||||
// the user's profile.
|
||||
key.metadataOrNull()?.flow?.value == null &&
|
||||
outbox.all { it in cannotConnectRelays || since.since(key)?.get(it) != null } ->
|
||||
outbox + indexRelays
|
||||
else -> outbox
|
||||
}
|
||||
|
||||
(relays - cannotConnectRelays).forEach {
|
||||
add(it, key)
|
||||
|
||||
+3
@@ -59,6 +59,9 @@ class UserWatcherSubAssembler(
|
||||
}
|
||||
}
|
||||
}
|
||||
// Re-evaluate filters: filterUserMetadataForKey may widen to indexer
|
||||
// relays once a user's outbox is exhausted without yielding metadata.
|
||||
invalidateFilters()
|
||||
}
|
||||
|
||||
val sub =
|
||||
|
||||
Reference in New Issue
Block a user