debug: add logging to track kind:1 event hydration

- Log when kind:1 events are fetched by EventLoader
- Log when kind:1 events are hydrated with content
- Helps diagnose why text content isn't displaying for bookmarked notes
This commit is contained in:
Gigi
2025-10-21 23:52:39 +02:00
parent d20cc684c3
commit 96451e6173
2 changed files with 19 additions and 0 deletions

View File

@@ -146,6 +146,16 @@ class BookmarkController {
idToEvent.set(event.id, event)
// Debug logging for kind:1 events
if (event.kind === 1) {
console.log('📝 Fetched kind:1 event:', {
id: event.id.slice(0, 8),
content: event.content?.slice(0, 50),
contentLength: event.content?.length,
created_at: event.created_at
})
}
// Also index by coordinate for addressable events
if (event.kind && event.kind >= 30000 && event.kind < 40000) {
const dTag = event.tags?.find((t: string[]) => t[0] === 'd')?.[1] || ''

View File

@@ -184,6 +184,15 @@ export function hydrateItems(
}
}
// Debug logging for kind:1 events
if (ev.kind === 1 && content) {
console.log('💧 Hydrated kind:1 with content:', {
id: item.id.slice(0, 8),
content: content.slice(0, 50),
contentLength: content.length
})
}
// Ensure all events with content get parsed content for proper rendering
const parsedContent = content ? (getParsedContent(content) as ParsedContent) : undefined