mirror of
https://github.com/dergigi/boris.git
synced 2026-01-17 22:04:32 +01:00
debug: add detailed logging to hydrateItems
- Log which kind:1 items are being processed - Show how many match events in the idToEvent map - Compare sample IDs from items vs map keys - Identify ID mismatch issue between bookmarks and fetched events
This commit is contained in:
@@ -170,6 +170,20 @@ export function hydrateItems(
|
||||
items: IndividualBookmark[],
|
||||
idToEvent: Map<string, NostrEvent>
|
||||
): IndividualBookmark[] {
|
||||
// Debug: log what we're trying to hydrate
|
||||
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))
|
||||
})
|
||||
}
|
||||
|
||||
return items
|
||||
.map(item => {
|
||||
const ev = idToEvent.get(item.id)
|
||||
|
||||
Reference in New Issue
Block a user