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
This commit is contained in:
Gigi
2025-10-22 00:13:38 +02:00
parent 30ed5fb436
commit 96ef227f79

View File

@@ -152,6 +152,14 @@ class BookmarkController {
idToEvent.set(event.id, event) 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) { if (event.kind === 1 && event.content) {
console.log('✅ Fetched kind:1 with content:', { console.log('✅ Fetched kind:1 with content:', {
id: event.id.slice(0, 12), id: event.id.slice(0, 12),
@@ -275,6 +283,10 @@ class BookmarkController {
console.log(`📋 Requesting hydration for: ${noteIds.length} note IDs, ${coordinates.length} coordinates`) 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 // Helper to build and emit bookmarks
const emitBookmarks = (idToEvent: Map<string, NostrEvent>) => { const emitBookmarks = (idToEvent: Map<string, NostrEvent>) => {
const allBookmarks = dedupeBookmarksById([ const allBookmarks = dedupeBookmarksById([