diff --git a/src/services/bookmarkHelpers.ts b/src/services/bookmarkHelpers.ts index 9063cedb..dc5654a8 100644 --- a/src/services/bookmarkHelpers.ts +++ b/src/services/bookmarkHelpers.ts @@ -67,12 +67,15 @@ export const processApplesauceBookmarks = ( ): IndividualBookmark[] => { if (!bookmarks) return [] + console.log('[BOOKMARK_TS] processApplesauceBookmarks called with parentCreatedAt:', parentCreatedAt, 'isPrivate:', isPrivate) + if (typeof bookmarks === 'object' && bookmarks !== null && !Array.isArray(bookmarks)) { const applesauceBookmarks = bookmarks as ApplesauceBookmarks const allItems: IndividualBookmark[] = [] // Process notes (EventPointer[]) if (applesauceBookmarks.notes) { + console.log('[BOOKMARK_TS] Processing', applesauceBookmarks.notes.length, 'notes with timestamp:', parentCreatedAt || 0) applesauceBookmarks.notes.forEach((note: EventPointer) => { allItems.push({ id: note.id, @@ -91,6 +94,7 @@ export const processApplesauceBookmarks = ( // Process articles (AddressPointer[]) if (applesauceBookmarks.articles) { + console.log('[BOOKMARK_TS] Processing', applesauceBookmarks.articles.length, 'articles with timestamp:', parentCreatedAt || 0) applesauceBookmarks.articles.forEach((article: AddressPointer) => { // Convert AddressPointer to coordinate format: kind:pubkey:identifier const coordinate = `${article.kind}:${article.pubkey}:${article.identifier || ''}` @@ -129,6 +133,7 @@ export const processApplesauceBookmarks = ( // Process URLs (string[]) if (applesauceBookmarks.urls) { + console.log('[BOOKMARK_TS] Processing', applesauceBookmarks.urls.length, 'URLs with timestamp:', parentCreatedAt || 0) applesauceBookmarks.urls.forEach((url: string) => { allItems.push({ id: `url-${url}`, diff --git a/src/services/bookmarkProcessing.ts b/src/services/bookmarkProcessing.ts index dfbd4137..6901b476 100644 --- a/src/services/bookmarkProcessing.ts +++ b/src/services/bookmarkProcessing.ts @@ -121,6 +121,7 @@ export async function collectBookmarksFromEvents( const decryptJobs: Array<{ evt: NostrEvent; metadata: { dTag?: string; setTitle?: string; setDescription?: string; setImage?: string } }> = [] for (const evt of bookmarkListEvents) { + console.log('[BOOKMARK_TS] Processing bookmark event', evt.id, 'kind:', evt.kind, 'created_at:', evt.created_at) newestCreatedAt = Math.max(newestCreatedAt, evt.created_at || 0) if (!latestContent && evt.content && !Helpers.hasHiddenContent(evt)) latestContent = evt.content if (Array.isArray(evt.tags)) allTags = allTags.concat(evt.tags)