refactor: cleanup after bunker signing implementation

- Remove reconnectBunkerSigner function, inline logic into App.tsx for better control
- Clean up try-catch wrapper in highlightCreationService, signing now works reliably
- Remove extra logging from signing process (already has [bunker] prefix logs)
- Simplify nostrConnect.ts to just export permissions helper
- Update api/article-og.ts to use local relay config instead of import
- All bunker signing tests now passing 
This commit is contained in:
Gigi
2025-10-16 23:39:31 +02:00
parent a479903ce3
commit bcb28a63a7
6 changed files with 145 additions and 144 deletions

View File

@@ -48,8 +48,6 @@ export async function createHighlight(
// Create EventFactory with the account as signer
const factory = new EventFactory({ signer: account })
// Let signer.requireConnection handle connectivity during sign
let blueprintSource: NostrEvent | AddressPointer | string
let context: string | undefined
@@ -119,19 +117,8 @@ export async function createHighlight(
// Sign the event
console.log('[bunker] Signing highlight event...', { kind: highlightEvent.kind, tags: highlightEvent.tags.length })
let signedEvent
try {
console.log('[bunker] Signer before sign:', {
type: (account as any).signer?.constructor?.name,
listening: (account as any).signer?.listening,
connected: (account as any).signer?.isConnected
})
signedEvent = await factory.sign(highlightEvent)
console.log('[bunker] ✅ Highlight signed successfully!', { id: signedEvent.id?.slice(0, 8) })
} catch (err) {
console.error('[bunker] ❌ Highlight signing failed:', err)
throw err
}
const signedEvent = await factory.sign(highlightEvent)
console.log('[bunker] ✅ Highlight signed successfully!', { id: signedEvent.id.slice(0, 8) })
// Use unified write service to store and publish
await publishEvent(relayPool, eventStore, signedEvent)