mirror of
https://github.com/dergigi/boris.git
synced 2025-12-24 01:54:19 +01:00
fix(article): query union of naddr relay hints and configured relays to prevent post-load ‘Article not found’ refresh
This commit is contained in:
@@ -97,10 +97,10 @@ export async function fetchArticleByNaddr(
|
|||||||
|
|
||||||
const pointer = decoded.data as AddressPointer
|
const pointer = decoded.data as AddressPointer
|
||||||
|
|
||||||
// Define relays to query - prefer relays from naddr, fallback to configured relays (including local)
|
// Define relays to query - use union of relay hints from naddr and configured relays
|
||||||
const baseRelays = pointer.relays && pointer.relays.length > 0
|
// This avoids failures when naddr contains stale/unreachable relay hints
|
||||||
? pointer.relays
|
const hintedRelays = (pointer.relays && pointer.relays.length > 0) ? pointer.relays : []
|
||||||
: RELAYS
|
const baseRelays = Array.from(new Set<string>([...hintedRelays, ...RELAYS]))
|
||||||
const orderedRelays = prioritizeLocalRelays(baseRelays)
|
const orderedRelays = prioritizeLocalRelays(baseRelays)
|
||||||
const { local: localRelays, remote: remoteRelays } = partitionRelays(orderedRelays)
|
const { local: localRelays, remote: remoteRelays } = partitionRelays(orderedRelays)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user