From f02bc21faf74600c00f38ccd3047ee1bf243e83f Mon Sep 17 00:00:00 2001 From: Gigi Date: Wed, 22 Oct 2025 00:10:13 +0200 Subject: [PATCH] debug: simplify hydration logging for easier diagnosis - Show how many items were matched in the map - If zero matches, show actual IDs from both sides - Makes it easy to see ID mismatch issues --- src/services/bookmarkHelpers.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/services/bookmarkHelpers.ts b/src/services/bookmarkHelpers.ts index ba2797f2..c72f5fcd 100644 --- a/src/services/bookmarkHelpers.ts +++ b/src/services/bookmarkHelpers.ts @@ -174,14 +174,11 @@ export function hydrateItems( 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)) - }) + console.log(`💧 hydrateItems: ${found.length}/${kind1Items.length} kind:1 items found in map (map has ${idToEvent.size} total events)`) + if (found.length === 0 && kind1Items.length > 0) { + console.log('❌ NO MATCHES! Sample item IDs:', kind1Items.slice(0, 3).map(b => b.id)) + console.log('❌ Map keys:', Array.from(idToEvent.keys()).slice(0, 3)) + } } return items