From bd29dfd65f7951fd58c48751bb11ded93ba8acd5 Mon Sep 17 00:00:00 2001 From: Gigi Date: Fri, 17 Oct 2025 00:26:54 +0200 Subject: [PATCH] chore(bunker): warn if remote pubkey equals user pubkey (invalid state) - Add sanity check and toast guidance to reconnect via Amber - Helps catch misconfigured bunker URIs that would never respond to requests --- src/App.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/App.tsx b/src/App.tsx index ce828cee..f52e2f8f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -259,6 +259,11 @@ function App() { if (account && account.type === 'nostr-connect') { const nostrConnectAccount = account as Accounts.NostrConnectAccount + // Sanity check: remote (bunker) pubkey must not equal our pubkey + if (nostrConnectAccount.signer.remote === nostrConnectAccount.pubkey) { + console.warn('[bunker] ❌ Invalid bunker state: remote pubkey equals user pubkey. Please reconnect using a fresh bunker URI from Amber.') + try { showToast?.('Reconnect bunker from Amber: invalid remote pubkey detected') } catch {} + } // Skip if we've already reconnected this account if (reconnectedAccounts.has(account.id)) {