mirror of
https://github.com/dergigi/boris.git
synced 2025-12-19 07:34:28 +01:00
refactor: remove excessive debug logging
This commit is contained in:
@@ -357,19 +357,6 @@ class BookmarkController {
|
|||||||
return (b.listUpdatedAt || 0) - (a.listUpdatedAt || 0)
|
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 = {
|
const bookmark: Bookmark = {
|
||||||
id: `${activeAccount.pubkey}-bookmarks`,
|
id: `${activeAccount.pubkey}-bookmarks`,
|
||||||
title: `Bookmarks (${sortedBookmarks.length})`,
|
title: `Bookmarks (${sortedBookmarks.length})`,
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ export const processApplesauceBookmarks = (
|
|||||||
const processed = bookmarkArray
|
const processed = bookmarkArray
|
||||||
.filter((bookmark: BookmarkData) => bookmark.id) // Skip bookmarks without valid IDs
|
.filter((bookmark: BookmarkData) => bookmark.id) // Skip bookmarks without valid IDs
|
||||||
.map((bookmark: BookmarkData) => {
|
.map((bookmark: BookmarkData) => {
|
||||||
const result = {
|
return {
|
||||||
id: bookmark.id!,
|
id: bookmark.id!,
|
||||||
content: bookmark.content || '',
|
content: bookmark.content || '',
|
||||||
created_at: bookmark.created_at || 0,
|
created_at: bookmark.created_at || 0,
|
||||||
@@ -168,16 +168,6 @@ export const processApplesauceBookmarks = (
|
|||||||
isPrivate,
|
isPrivate,
|
||||||
listUpdatedAt: parentCreatedAt || 0
|
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
|
return processed
|
||||||
|
|||||||
@@ -131,9 +131,6 @@ export async function collectBookmarksFromEvents(
|
|||||||
const setImage = evt.kind === 30003 ? evt.tags?.find((t: string[]) => t[0] === 'image')?.[1] : undefined
|
const setImage = evt.kind === 30003 ? evt.tags?.find((t: string[]) => t[0] === 'image')?.[1] : undefined
|
||||||
const metadata = { dTag, setTitle, setDescription, setImage }
|
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
|
// Handle web bookmarks (kind:39701) as individual bookmarks
|
||||||
if (evt.kind === 39701) {
|
if (evt.kind === 39701) {
|
||||||
publicItemsAll.push({
|
publicItemsAll.push({
|
||||||
|
|||||||
Reference in New Issue
Block a user