refactor: remove excessive debug logging

This commit is contained in:
Gigi
2025-10-22 12:29:09 +02:00
parent 4f78ee4794
commit 9b21075a9b
3 changed files with 1 additions and 27 deletions

View File

@@ -356,19 +356,6 @@ class BookmarkController {
// Newest first (descending)
return (b.listUpdatedAt || 0) - (a.listUpdatedAt || 0)
})
// DEBUG: Log sorting details for top 10 bookmarks
console.log('🔍 Bookmark Sorting Debug:')
sortedBookmarks.slice(0, 10).forEach((b, i) => {
const listUpdated = b.listUpdatedAt ? new Date(b.listUpdatedAt * 1000).toISOString() : 'none'
const contentCreated = b.created_at ? new Date(b.created_at * 1000).toISOString() : 'none'
const contentPreview = (b.content || '').substring(0, 50)
console.log(` ${i + 1}. [${b.type}]`)
console.log(` list updated: ${listUpdated}`)
console.log(` content created: ${contentCreated}`)
console.log(` content: "${contentPreview}"`)
})
console.log(`Total bookmarks: ${sortedBookmarks.length}\n`)
const bookmark: Bookmark = {
id: `${activeAccount.pubkey}-bookmarks`,

View File

@@ -156,7 +156,7 @@ export const processApplesauceBookmarks = (
const processed = bookmarkArray
.filter((bookmark: BookmarkData) => bookmark.id) // Skip bookmarks without valid IDs
.map((bookmark: BookmarkData) => {
const result = {
return {
id: bookmark.id!,
content: bookmark.content || '',
created_at: bookmark.created_at || 0,
@@ -168,16 +168,6 @@ export const processApplesauceBookmarks = (
isPrivate,
listUpdatedAt: parentCreatedAt || 0
}
// DEBUG: Log timestamp assignment
if (Math.random() < 0.05) { // Log ~5% of bookmarks to avoid spam
console.log('📌 Processing bookmark:')
console.log(` content created_at: ${result.created_at ? new Date(result.created_at * 1000).toISOString() : 'none'}`)
console.log(` list updated at: ${result.listUpdatedAt ? new Date(result.listUpdatedAt * 1000).toISOString() : 'none'}`)
console.log(` content preview: "${(bookmark.content || '').substring(0, 40)}"`)
}
return result
})
return processed

View File

@@ -130,9 +130,6 @@ export async function collectBookmarksFromEvents(
const setDescription = evt.kind === 30003 ? evt.tags?.find((t: string[]) => t[0] === 'description')?.[1] : undefined
const setImage = evt.kind === 30003 ? evt.tags?.find((t: string[]) => t[0] === 'image')?.[1] : undefined
const metadata = { dTag, setTitle, setDescription, setImage }
// DEBUG: Log bookmark list event processing
console.log(`📋 Processing bookmark list event kind:${evt.kind}, created_at: ${evt.created_at ? new Date(evt.created_at * 1000).toISOString() : 'none'}`)
// Handle web bookmarks (kind:39701) as individual bookmarks
if (evt.kind === 39701) {