mirror of
https://github.com/dergigi/boris.git
synced 2026-01-24 09:14:39 +01:00
debug: add extensive logging to track bookmark flow
Simplified to only show unencrypted bookmarks: - Skip encrypted events entirely (no decrypt for now) - This eliminates all parse errors Added comprehensive logging: - Controller: log when building, how many items, how many listeners, when emitting - App: log when subscribing, when receiving bookmarks, when loading state changes This will help identify where the disconnect is between controller and sidebar.
This commit is contained in:
@@ -106,14 +106,10 @@ class BookmarkController {
|
||||
): Promise<void> {
|
||||
const allEvents = Array.from(this.currentEvents.values())
|
||||
|
||||
// Only process events that are ready (unencrypted or already decrypted)
|
||||
const readyEvents = allEvents.filter(evt => {
|
||||
const isEncrypted = hasEncryptedContent(evt)
|
||||
if (!isEncrypted) return true // Unencrypted - ready
|
||||
return this.decryptedEvents.has(evt.id) // Encrypted - only if decrypted
|
||||
})
|
||||
// Only process unencrypted events for now (skip encrypted entirely)
|
||||
const readyEvents = allEvents.filter(evt => !hasEncryptedContent(evt))
|
||||
|
||||
console.log('[controller] 📋 Building bookmarks:', readyEvents.length, 'ready of', allEvents.length, 'total')
|
||||
console.log('[controller] 📋 Building bookmarks:', readyEvents.length, 'unencrypted of', allEvents.length, 'total')
|
||||
|
||||
if (readyEvents.length === 0) {
|
||||
this.bookmarksListeners.forEach(cb => cb([]))
|
||||
@@ -231,6 +227,7 @@ class BookmarkController {
|
||||
}
|
||||
|
||||
console.log('[controller] 📋 Built bookmark with', sortedBookmarks.length, 'items')
|
||||
console.log('[controller] 📤 Emitting to', this.bookmarksListeners.length, 'listeners')
|
||||
this.bookmarksListeners.forEach(cb => cb([bookmark]))
|
||||
} catch (error) {
|
||||
console.error('[controller] ❌ Failed to build bookmarks:', error)
|
||||
|
||||
Reference in New Issue
Block a user