From 0f5d42465dfc32374ccff4c16013da0426ee897b Mon Sep 17 00:00:00 2001 From: Gigi Date: Wed, 22 Oct 2025 00:08:47 +0200 Subject: [PATCH] debug: add detailed logging to hydrateItems - Log which kind:1 items are being processed - Show how many match events in the idToEvent map - Compare sample IDs from items vs map keys - Identify ID mismatch issue between bookmarks and fetched events --- src/services/bookmarkHelpers.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/services/bookmarkHelpers.ts b/src/services/bookmarkHelpers.ts index 3795d5a7..ba2797f2 100644 --- a/src/services/bookmarkHelpers.ts +++ b/src/services/bookmarkHelpers.ts @@ -170,6 +170,20 @@ export function hydrateItems( items: IndividualBookmark[], idToEvent: Map ): IndividualBookmark[] { + // Debug: log what we're trying to hydrate + const kind1Items = items.filter(b => b.kind === 1) + if (kind1Items.length > 0 && idToEvent.size > 0) { + const found = kind1Items.filter(b => idToEvent.has(b.id)) + console.log('💧 hydrateItems processing:', { + totalKind1Items: kind1Items.length, + mapSize: idToEvent.size, + found: found.length, + notFound: kind1Items.length - found.length, + sampleItemIds: kind1Items.slice(0, 2).map(b => b.id.slice(0, 12)), + sampleMapKeys: Array.from(idToEvent.keys()).slice(0, 2).map(id => id.slice(0, 12)) + }) + } + return items .map(item => { const ev = idToEvent.get(item.id)