mirror of
https://github.com/dergigi/boris.git
synced 2025-12-25 10:34:28 +01:00
debug(bunker): log signer publish/subscribe calls and relay connectivity
- Wrap NostrConnectSigner publish/subscription to log relays and filters - Log relayPool connectivity snapshot before bookmark decryption - Helps diagnose decrypt requests not reaching Amber
This commit is contained in:
13
src/App.tsx
13
src/App.tsx
@@ -301,6 +301,19 @@ function App() {
|
||||
// Replace the signer on the account
|
||||
nostrConnectAccount.signer = recreatedSigner
|
||||
console.log('[bunker] ✅ Signer recreated with pool context')
|
||||
|
||||
// Debug: log publish/subscription calls made by signer (decrypt/sign requests)
|
||||
const originalPublish = (recreatedSigner as any).publishMethod
|
||||
;(recreatedSigner as any).publishMethod = (relays: string[], event: any) => {
|
||||
try { console.log('[bunker] publish via signer:', { relays, kind: event?.kind, tags: event?.tags?.length }) } catch {}
|
||||
return originalPublish(relays, event)
|
||||
}
|
||||
const originalSubscribe = (recreatedSigner as any).subscriptionMethod
|
||||
;(recreatedSigner as any).subscriptionMethod = (relays: string[], filters: any[]) => {
|
||||
try { console.log('[bunker] subscribe via signer:', { relays, filters }) } catch {}
|
||||
return originalSubscribe(relays, filters)
|
||||
}
|
||||
|
||||
|
||||
// Just ensure the signer is listening for responses - don't call connect() again
|
||||
// The fromBunkerURI already connected with permissions during login
|
||||
|
||||
@@ -107,7 +107,14 @@ export const fetchBookmarks = async (
|
||||
console.log('[bunker] 🔑 Signer has nip04:', hasNip04Decrypt(signerCandidate))
|
||||
console.log('[bunker] 🔑 Signer has nip44:', hasNip44Decrypt(signerCandidate))
|
||||
}
|
||||
const { publicItemsAll, privateItemsAll, newestCreatedAt, latestContent, allTags } = await collectBookmarksFromEvents(
|
||||
|
||||
// Debug relay connectivity for bunker relays
|
||||
try {
|
||||
const urls = Array.from(relayPool.relays.values()).map(r => ({ url: r.url, connected: (r as any).connected }))
|
||||
console.log('[bunker] Relay connections:', urls)
|
||||
} catch {}
|
||||
|
||||
const { publicItemsAll, privateItemsAll, newestCreatedAt, latestContent, allTags } = await collectBookmarksFromEvents(
|
||||
bookmarkListEvents,
|
||||
activeAccount,
|
||||
signerCandidate
|
||||
|
||||
Reference in New Issue
Block a user