From 8f055f71bf07e17be67923965f07bc7ec44d1259 Mon Sep 17 00:00:00 2001 From: Avi Date: Wed, 23 Sep 2026 13:02:19 -0500 Subject: [PATCH] fix(nip46): spec-correct connect params, full-handshake [NIP46] trace, visible handshake errors --- frontend/src/screens/SignerModeScreen.tsx | 20 ++ frontend/src/test/SignerModeScreen.test.tsx | 72 +++++ frontend/src/test/fakeBackend.ts | 46 +++ src/signer/nip46_client.rs | 334 +++++++++++++++++--- tests/nip46_e2e.rs | 253 ++++++++++++++- 5 files changed, 673 insertions(+), 52 deletions(-) create mode 100644 frontend/src/test/SignerModeScreen.test.tsx diff --git a/frontend/src/screens/SignerModeScreen.tsx b/frontend/src/screens/SignerModeScreen.tsx index 1385bf0..2bdd00f 100644 --- a/frontend/src/screens/SignerModeScreen.tsx +++ b/frontend/src/screens/SignerModeScreen.tsx @@ -592,6 +592,11 @@ export function SignerModeScreen() { Waiting for the signer to scan… the connection appears automatically once approved. The code expires after a few minutes.

+ {nip46StatusState?.error && ( + + {nip46StatusState.error} + + )} {pairError && {pairError}}
{error && {error}} {pairError && {pairError}} + {/* A failed handshake must never look like an idle form: + surface the backend's error so a timeout is visible. */} + {nip46StatusState?.error && ( + + {nip46StatusState.error} + + )} + {/* A sent-but-unapproved connection request is in flight: + say so instead of showing a blank form. */} + {!nip46StatusState?.error && (nip46StatusState?.relays?.length ?? 0) > 0 && ( +

+ Connection request sent — approve it in Amber. This updates automatically; it + can take up to a couple of minutes on a slow network. +

+ )}
{mode === 'nip46_client' && (