Fix watch history hydration by prioritizing readRelays

The `createWatchHistoryHydrationStage` in the feed engine was incorrectly relying solely on `nostrClient.relays` for network fetches. This could cause hydration failures if `relays` contained write-only servers or was otherwise restricted. This commit updates the logic to prioritize `nostrClient.readRelays` if available, falling back to `nostrClient.relays`. This ensures that hydration attempts query the correct relays configured for reading data.

Fixes an issue where watch history items would display as "Untitled video" due to failed metadata resolution.
This commit is contained in:
google-labs-jules[bot] committed 2026-01-06 13:11:39 +00:00
1 parent 66bfc44cb6
commit 93c88704e0
1 file changed
+8 -1
+8 -1
View File
@@ -318,11 +318,18 @@ function createWatchHistoryHydrationStage() {
const uniqueIds = Array.from(new Set(missing));
const uniqueAddresses = Array.from(new Set(missingAddresses));
const relays =
const readRelays =
Array.isArray(nostrClient?.readRelays) && nostrClient.readRelays.length
? nostrClient.readRelays
: null;
const fallbackRelays =
Array.isArray(nostrClient?.relays) && nostrClient.relays.length
? nostrClient.relays
: null;
const relays = readRelays || fallbackRelays;
if (!relays || !nostrClient?.pool) {
return items;
}