mirror of
https://github.com/dergigi/boris.git
synced 2025-12-17 22:54:30 +01:00
feat: add detailed logging to debug bookmark event structure
- Add logging for raw events before deduplication to see all fetched events - Add detailed tag inspection for bookmark events including dTag and first few tags - Help identify if private bookmarks are in separate bookmark sets (30003) or main lists (10003)
This commit is contained in:
@@ -142,7 +142,13 @@ export const fetchBookmarks = async (
|
||||
.req(relayUrls, { kinds: [10003, 30003], authors: [activeAccount.pubkey] })
|
||||
.pipe(completeOnEose(), takeUntil(timer(10000)), toArray())
|
||||
)
|
||||
console.log('📊 Raw events fetched:', rawEvents.length, 'events')
|
||||
rawEvents.forEach((evt, i) => {
|
||||
console.log(` Event ${i}: kind=${evt.kind}, id=${evt.id?.slice(0, 8)}, dTag=${evt.tags?.find((t: string[]) => t[0] === 'd')?.[1] || 'none'}`)
|
||||
})
|
||||
|
||||
const bookmarkListEvents = dedupeNip51Events(rawEvents)
|
||||
console.log('📋 After deduplication:', bookmarkListEvents.length, 'bookmark events')
|
||||
if (bookmarkListEvents.length === 0) {
|
||||
setBookmarks([])
|
||||
setLoading(false)
|
||||
@@ -183,7 +189,9 @@ export const fetchBookmarks = async (
|
||||
contentPreview: evt.content?.slice(0, 50) + (evt.content?.length > 50 ? '...' : ''),
|
||||
tagsCount: evt.tags?.length || 0,
|
||||
hasHiddenContent: Helpers.hasHiddenContent(evt),
|
||||
canHaveHiddenTags: Helpers.canHaveHiddenTags(evt.kind)
|
||||
canHaveHiddenTags: Helpers.canHaveHiddenTags(evt.kind),
|
||||
dTag: evt.tags?.find((t: string[]) => t[0] === 'd')?.[1] || 'none',
|
||||
firstFewTags: evt.tags?.slice(0, 3).map((t: string[]) => `${t[0]}:${t[1]?.slice(0, 8)}`).join(', ') || 'none'
|
||||
})
|
||||
|
||||
newestCreatedAt = Math.max(newestCreatedAt, evt.created_at || 0)
|
||||
|
||||
Reference in New Issue
Block a user