mirror of
https://github.com/dergigi/boris.git
synced 2026-01-02 22:44:31 +01:00
feat: add debugging for private bookmark decryption
- Added detailed logging to understand why getHiddenBookmarks returns undefined - Check bookmark list content and encryption format - Verify account has decryption capabilities - Pass full account object with extension capabilities to applesauce helpers - This will help diagnose the NIP-44 vs NIP-04 encryption issue
This commit is contained in:
@@ -20,6 +20,12 @@ interface ApplesauceBookmarks {
|
||||
urls?: BookmarkData[]
|
||||
}
|
||||
|
||||
interface AccountWithExtension {
|
||||
pubkey: string
|
||||
[key: string]: unknown // Allow other properties from the full account object
|
||||
}
|
||||
|
||||
|
||||
const processBookmarks = (
|
||||
bookmarks: unknown,
|
||||
activeAccount: ActiveAccount,
|
||||
@@ -75,9 +81,10 @@ const processApplesauceBookmarks = (
|
||||
return processBookmarks(bookmarks, activeAccount, isPrivate)
|
||||
}
|
||||
|
||||
|
||||
export const fetchBookmarks = async (
|
||||
relayPool: RelayPool,
|
||||
activeAccount: ActiveAccount,
|
||||
activeAccount: AccountWithExtension, // Full account object with extension capabilities
|
||||
setBookmarks: (bookmarks: Bookmark[]) => void,
|
||||
setLoading: (loading: boolean) => void,
|
||||
timeoutId: number
|
||||
@@ -114,6 +121,14 @@ export const fetchBookmarks = async (
|
||||
console.log('Public bookmarks:', publicBookmarks)
|
||||
console.log('Private bookmarks:', privateBookmarks)
|
||||
|
||||
// Debug the bookmark list event content
|
||||
console.log('Bookmark list content:', bookmarkListEvent.content)
|
||||
console.log('Bookmark list content type:', typeof bookmarkListEvent.content)
|
||||
console.log('Has encrypted content:', bookmarkListEvent.content && bookmarkListEvent.content.includes(':'))
|
||||
console.log('Account type:', typeof activeAccount)
|
||||
console.log('Account has decrypt method:', typeof activeAccount.decrypt)
|
||||
|
||||
|
||||
// Process bookmarks using DRY helper function
|
||||
// Handle the structure that applesauce returns: {notes: [], articles: [], hashtags: [], urls: []}
|
||||
const publicItems = processApplesauceBookmarks(publicBookmarks, activeAccount, false)
|
||||
|
||||
Reference in New Issue
Block a user