From 2542e9739878b0fcaf5fa8bbd8ad5797f6da0246 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Wed, 24 Sep 2025 16:27:51 -0400 Subject: [PATCH] Document relay readiness probe --- js/nostr.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/nostr.js b/js/nostr.js index b13765cd..e043cff3 100644 --- a/js/nostr.js +++ b/js/nostr.js @@ -220,6 +220,11 @@ class NostrClient { } } + // We subscribe to kind `0` purely as a liveness probe because almost every + // relay can answer it quickly. Either an `event` or `eose` signals success, + // while the 5s timer guards against relays that never respond. We immediately + // `unsub` to avoid leaking subscriptions. Note: any future change must still + // provide a lightweight readiness check with similar timeout semantics. async connectToRelays() { return Promise.all( this.relays.map(