Merge pull request #243 from PR0M3TH3AN/codex/fix-watch-history-not-displaying-videos

Stop registering deprecated relay publish handlers
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2025-10-02 09:08:11 -04:00
commit d17047c6ea
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;
}