mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 12:52:26 +00:00
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:
1 parent
66bfc44cb6
commit
93c88704e0
1 file changed
+8
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user