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:
Vitor Pamplona
2026-05-26 21:55:32 -04:00
committed by GitHub
2 changed files with 16 additions and 2 deletions
@@ -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)
@@ -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 =