debug: add extensive logging and alerts to diagnose bookmark fetching

- Add console logs for relay group creation and relay URLs
- Add detailed logging in Bookmarks useEffect to track dependencies
- Add alert to confirm bookmark fetch is starting
- Log addressLoader and activeAccount availability
- Track when fetchBookmarks is called vs when dependencies are missing

This will help diagnose why bookmarks aren't appearing and
why console logs might not be visible.
This commit is contained in:
Gigi
2025-10-02 08:37:50 +02:00
parent 8058a99cf2
commit f0cf31252f
2 changed files with 8 additions and 0 deletions

View File

@@ -40,6 +40,7 @@ function App() {
// Note: We could use pool.group(relayUrls) for direct requests in the future
pool.group(relayUrls)
console.log('Created relay group with', relayUrls.length, 'relays')
console.log('Relay URLs:', relayUrls)
// Create address loader using the pool directly
// The pool will handle relay connections and the address loader will use the group

View File

@@ -52,8 +52,14 @@ const Bookmarks: React.FC<BookmarksProps> = ({ addressLoader, onLogout }) => {
const profile = useEventModel(Models.ProfileModel, activeAccount ? [activeAccount.pubkey] : null)
useEffect(() => {
console.log('Bookmarks useEffect triggered')
console.log('addressLoader:', !!addressLoader)
console.log('activeAccount:', !!activeAccount)
if (addressLoader && activeAccount) {
console.log('Starting to fetch bookmarks...')
fetchBookmarks()
} else {
console.log('Not fetching bookmarks - missing dependencies')
}
}, [addressLoader, activeAccount])
@@ -63,6 +69,7 @@ const Bookmarks: React.FC<BookmarksProps> = ({ addressLoader, onLogout }) => {
try {
setLoading(true)
console.log('Fetching bookmarks for pubkey:', activeAccount.pubkey)
alert('Starting bookmark fetch for: ' + activeAccount.pubkey.slice(0, 8) + '...')
// Use applesauce address loader to fetch bookmark lists (kind 10003)
// This is the proper way according to NIP-51 and applesauce documentation