mirror of
https://github.com/dergigi/boris.git
synced 2025-12-24 10:04:19 +01:00
debug: add logging to bookmark grouping to diagnose missing bookmarks
Added console logs to groupIndividualBookmarks to see: - Total items being grouped - Count per group (nip51Public, nip51Private, amethystPublic, amethystPrivate, standaloneWeb) - Sample of first 3 items with their sourceKind and isPrivate properties This will help diagnose why 532 bookmarks are emitted but not appearing in sidebar.
This commit is contained in:
@@ -93,6 +93,8 @@ export const sortIndividualBookmarks = (items: IndividualBookmark[]) => {
|
||||
export function groupIndividualBookmarks(items: IndividualBookmark[]) {
|
||||
const sorted = sortIndividualBookmarks(items)
|
||||
|
||||
console.log('[bookmark] 🗂️ Grouping', sorted.length, 'items')
|
||||
|
||||
// Group by source list, not by content type
|
||||
const nip51Public = sorted.filter(i => i.sourceKind === 10003 && !i.isPrivate)
|
||||
const nip51Private = sorted.filter(i => i.sourceKind === 10003 && i.isPrivate)
|
||||
@@ -100,6 +102,23 @@ export function groupIndividualBookmarks(items: IndividualBookmark[]) {
|
||||
const amethystPrivate = sorted.filter(i => i.sourceKind === 30001 && i.isPrivate)
|
||||
const standaloneWeb = sorted.filter(i => i.sourceKind === 39701)
|
||||
|
||||
console.log('[bookmark] 🗂️ Groups:', {
|
||||
nip51Public: nip51Public.length,
|
||||
nip51Private: nip51Private.length,
|
||||
amethystPublic: amethystPublic.length,
|
||||
amethystPrivate: amethystPrivate.length,
|
||||
standaloneWeb: standaloneWeb.length
|
||||
})
|
||||
|
||||
// Debug: sample first few items to see their properties
|
||||
if (sorted.length > 0) {
|
||||
console.log('[bookmark] 🗂️ Sample items:', sorted.slice(0, 3).map(i => ({
|
||||
sourceKind: i.sourceKind,
|
||||
isPrivate: i.isPrivate,
|
||||
id: i.id.slice(0, 16)
|
||||
})))
|
||||
}
|
||||
|
||||
return {
|
||||
nip51Public,
|
||||
nip51Private,
|
||||
|
||||
Reference in New Issue
Block a user