mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Fix watch history publish errors against nostr-tools 1.8
This commit is contained in:
1 parent
d9388db649
commit
bf088532dc
1 file changed
+9
-2
+9
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user