From cdfda57c06e60ea235e54815a7734ad66484016f Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 1 Aug 2026 12:28:20 -0700 Subject: Instrument the silent NWC request-drop paths Every guard in onRequest now names itself when it drops an event, and listen()/stop() log subscription generations so a later listen() killing the live sub becomes visible. subscribeOn passes extra params through so relay-initiated CLOSED reasons surface too. Co-Authored-By: Claude Fable 5 --- src/nostr.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nostr.js') diff --git a/src/nostr.js b/src/nostr.js index 1a86499..0b902e1 100644 --- a/src/nostr.js +++ b/src/nostr.js @@ -27,9 +27,9 @@ const pool = new SimplePool(); // feature's configuration. NWC needs this: the relays it advertises in a // connection URI must be exactly the ones it listens on, or a client's // request lands somewhere the wallet isn't and it waits forever. -export function subscribeOn(relays, filter, onEvent) { +export function subscribeOn(relays, filter, onEvent, extra = {}) { try { - const sub = pool.subscribeMany(relays, [filter], { onevent: onEvent }); + const sub = pool.subscribeMany(relays, [filter], { onevent: onEvent, ...extra }); return () => { try { sub.close(); } catch {} }; } catch { return () => {}; } } -- cgit v1.2.3