Fix watch history publish errors against nostr-tools 1.8

This commit is contained in:
thePR0M3TH3AN committed 2025-10-02 09:02:55 -04:00
1 parent d9388db649
commit bf088532dc
1 file changed
+9 -2
+9 -2
View File
@@ -115,11 +115,18 @@ export function publishEventToRelay(pool, url, event, options = {}) {
let handlerRegistered = false;
handlerRegistered =
registerHandler("ok", handleSuccess) || handlerRegistered;
handlerRegistered =
registerHandler("seen", handleSuccess) || handlerRegistered;
handlerRegistered =
registerHandler("failed", handleFailure) || handlerRegistered;
// [email protected] removed the optional "seen" callback from relay
// publish handles. Attempting to register it now produces an
// asynchronous TypeError that bubbles up as an unhandled rejection and
// prevents watch-history snapshots from ever resolving. We therefore
// skip registering a "seen" listener and rely on "ok" (per NIP-20) for
// success notifications. Legacy relays that only emit "seen" fall back
// to the optimistic success path below because no handlers end up
// registered.
if (handlerRegistered) {
return;
}