From 0b8f88ea1d4119604ae13d3544247b45f85ab3a1 Mon Sep 17 00:00:00 2001 From: Gigi Date: Thu, 16 Oct 2025 23:28:06 +0200 Subject: [PATCH] revert(highlight): avoid pre-connect; rely on requireConnection during sign - Remove manual connect/open in highlight flow - Prevent side-effects that may interfere with pending requests --- src/services/highlightCreationService.ts | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/services/highlightCreationService.ts b/src/services/highlightCreationService.ts index f6251bc1..78c51beb 100644 --- a/src/services/highlightCreationService.ts +++ b/src/services/highlightCreationService.ts @@ -48,24 +48,7 @@ export async function createHighlight( // Create EventFactory with the account as signer const factory = new EventFactory({ signer: account }) - // For NIP-46 (bunker) accounts, ensure connection before signing - try { - const signer = (account as unknown as { signer?: unknown })?.signer as unknown - const hasConnect = signer && typeof (signer as { connect?: unknown }).connect === 'function' - const hasOpen = signer && typeof (signer as { open?: unknown }).open === 'function' - const isListening = signer && (signer as { listening?: boolean }).listening === true - if (hasConnect) { - if (hasOpen && !isListening) { - console.log('[bunker] Opening signer subscription before signing...') - await (signer as { open: () => Promise }).open() - } - console.log('[bunker] Ensuring bunker connection before signing...') - await (signer as { connect: () => Promise }).connect() - console.log('[bunker] ✅ Bunker connection ready for signing') - } - } catch (err) { - console.warn('[bunker] ⚠️ Could not pre-connect signer (will rely on requireConnection):', err) - } + // Let signer.requireConnection handle connectivity during sign let blueprintSource: NostrEvent | AddressPointer | string let context: string | undefined