From 914e0abc58730eecd08cbc9abdb4f55f36151eae 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 03:43:08 +0000 Subject: [PATCH] Fix watch history hydration for address pointers with colons Updated `createWatchHistoryHydrationStage` in `js/feedEngine/watchHistoryFeed.js` to properly handle and hydrate watch history items that use address pointers (type 'a'), specifically fixing a bug where d-tags containing colons were being ignored. Previously, only event ID pointers (type 'e') were being hydrated, and an initial fix for addresses failed for d-tags with colons. This change robustly parses address pointers, constructs appropriate filters, fetches the events, and correctly maps them back to the history items using a `normalizeAddressKey` utility that handles mixed-case pubkeys and complex d-tags. --- js/feedEngine/watchHistoryFeed.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/js/feedEngine/watchHistoryFeed.js b/js/feedEngine/watchHistoryFeed.js index f6153992..cb92d324 100644 --- a/js/feedEngine/watchHistoryFeed.js +++ b/js/feedEngine/watchHistoryFeed.js @@ -284,14 +284,11 @@ function createWatchHistoryHydrationStage() { const addressFilters = new Map(); for (const address of uniqueAddresses) { const parts = address.split(":"); - if (parts.length !== 3) continue; + if (parts.length < 3) continue; const kind = Number(parts[0]); - const pubkey = parts[1]; // Keep original case for filter? No, fetch should be robust. - // Actually, Nostr pubkeys are lowercase hex. - // If the pointer has Uppercase pubkey, we should lowercase it for the filter - // because the relay will likely index it as lowercase or hex. + const pubkey = parts[1]; const normalizedPubkey = pubkey.toLowerCase(); - const dTag = parts[2]; + const dTag = parts.slice(2).join(":"); const key = `${kind}:${normalizedPubkey}`; if (!addressFilters.has(key)) {