From f9ce7983323d9535ad69c14a1158da2bf273b211 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 6 Jan 2026 14:27:26 +0000 Subject: [PATCH] Prioritize `d` tag in video pointer resolution When creating address pointers (`a` tags) for watch history, `resolveVideoPointer` was incorrectly prioritizing `videoRootId` over the actual NIP-33 `d` tag. If these values differed (common in newly published videos), the resulting pointer would reference a non-existent identifier, causing subsequent hydration to fail. This change swaps the order to prioritize the `d` tag, ensuring watch history entries use the correct addressable identifier. --- js/utils/videoPointer.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/utils/videoPointer.js b/js/utils/videoPointer.js index 948f481f..d269a06e 100644 --- a/js/utils/videoPointer.js +++ b/js/utils/videoPointer.js @@ -24,16 +24,16 @@ export function resolveVideoPointer({ const pointerCandidates = []; const normalizedRelay = normalizeString(relay); - const rootId = normalizeString(videoRootId); - if (rootId && normalizedPubkey) { - const ptr = ["a", `${normalizedKind}:${normalizedPubkey}:${rootId}`]; + const normalizedDTag = normalizeString(dTag); + if (normalizedDTag && normalizedPubkey) { + const ptr = ["a", `${normalizedKind}:${normalizedPubkey}:${normalizedDTag}`]; if (normalizedRelay) ptr.push(normalizedRelay); pointerCandidates.push(ptr); } - const normalizedDTag = normalizeString(dTag); - if (normalizedDTag && normalizedPubkey) { - const ptr = ["a", `${normalizedKind}:${normalizedPubkey}:${normalizedDTag}`]; + const rootId = normalizeString(videoRootId); + if (rootId && normalizedPubkey) { + const ptr = ["a", `${normalizedKind}:${normalizedPubkey}:${rootId}`]; if (normalizedRelay) ptr.push(normalizedRelay); pointerCandidates.push(ptr); }