From 5ce13c667d4022b19df11622bd10bf0495fc4575 Mon Sep 17 00:00:00 2001 From: Gigi Date: Sun, 2 Nov 2025 21:41:03 +0100 Subject: [PATCH] feat: ensure purplepag.es relay is used for profile lookups Add logic to check if purplepag.es is in the active relay pool when fetching profiles. If not, add it temporarily to ensure we query this relay for profile metadata. This should help find profiles that might not be available on other relays. Also adds debug logging to show which active relays are being queried. --- src/services/profileService.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/services/profileService.ts b/src/services/profileService.ts index 1cd30593..9d3ce5e7 100644 --- a/src/services/profileService.ts +++ b/src/services/profileService.ts @@ -231,6 +231,20 @@ export const fetchProfiles = async ( const { local: localRelays, remote: remoteRelays } = partitionRelays(prioritized) console.log(`[fetch-profiles] Querying ${localRelays.length} local relays and ${remoteRelays.length} remote relays`) + console.log(`[fetch-profiles] Active relays:`, relayUrls) + const hasPurplePages = relayUrls.some(url => url.includes('purplepag.es')) + if (!hasPurplePages) { + console.warn(`[fetch-profiles] purplepag.es not in active relay pool, adding it temporarily`) + // Add purplepag.es if it's not in the pool (it might not have connected yet) + const purplePagesUrl = 'wss://purplepag.es' + if (!relayPool.relays.has(purplePagesUrl)) { + relayPool.group([purplePagesUrl]) + } + // Ensure it's included in the remote relays for this fetch + if (!remoteRelays.includes(purplePagesUrl)) { + remoteRelays.push(purplePagesUrl) + } + } let eventCount = 0 const fetchedPubkeys = new Set()