From 96ef227f79c7a3cb118b23f1048b9f88f0f16de3 Mon Sep 17 00:00:00 2001 From: Gigi Date: Wed, 22 Oct 2025 00:13:38 +0200 Subject: [PATCH] debug: log all fetched events to identify ID mismatch - Show sample of note IDs being requested - Log every event fetched with kind and content length - Helps diagnose why kind:1 events aren't in the hydration map --- src/services/bookmarkController.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/services/bookmarkController.ts b/src/services/bookmarkController.ts index 17a799b0..71634f92 100644 --- a/src/services/bookmarkController.ts +++ b/src/services/bookmarkController.ts @@ -152,6 +152,14 @@ class BookmarkController { idToEvent.set(event.id, event) + // Log all fetched events to see what we're getting + console.log('📥 Fetched event:', { + id: event.id.slice(0, 12), + kind: event.kind, + contentLen: event.content?.length || 0, + totalInMap: idToEvent.size + }) + if (event.kind === 1 && event.content) { console.log('✅ Fetched kind:1 with content:', { id: event.id.slice(0, 12), @@ -275,6 +283,10 @@ class BookmarkController { console.log(`📋 Requesting hydration for: ${noteIds.length} note IDs, ${coordinates.length} coordinates`) + // Show sample of what we're requesting + const sampleIds = noteIds.slice(0, 3) + console.log(`📋 Sample note IDs to request:`, sampleIds) + // Helper to build and emit bookmarks const emitBookmarks = (idToEvent: Map) => { const allBookmarks = dedupeBookmarksById([