From 5acdaa3b52524e649fe434d828c5ab62c52a4182 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Thu, 29 Jan 2026 11:01:40 -0500 Subject: [PATCH] Respect list timeouts in incremental fetch --- js/nostr/client.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/nostr/client.js b/js/nostr/client.js index 5755a867..bbf84da6 100644 --- a/js/nostr/client.js +++ b/js/nostr/client.js @@ -3861,7 +3861,7 @@ export class NostrClient { const pool = await this.ensurePool(); const actualFetchFn = typeof fetchFn === "function" ? fetchFn - : (r, f) => pool.list([r], [f]); + : (r, f, timeout) => pool.list([r], [f], { timeout }); const chunks = []; for (let i = 0; i < normalizedRelays.length; i += concurrencyLimit) { @@ -3919,7 +3919,7 @@ export class NostrClient { try { // Wrap fetch with a timeout to prevent hanging on slow relays let events = await withRequestTimeout( - actualFetchFn(relayUrl, filter), + actualFetchFn(relayUrl, filter, listTimeoutMs), listTimeoutMs, null, `Fetch from ${relayUrl} timed out` @@ -3954,7 +3954,7 @@ export class NostrClient { try { delete filter.since; const events = await withRequestTimeout( - actualFetchFn(relayUrl, filter), + actualFetchFn(relayUrl, filter, listTimeoutMs), listTimeoutMs, null, `Full fetch fallback from ${relayUrl} timed out`