Merge pull request #1929 from PR0M3TH3AN/codex/update-fetchlistincrementally-for-timeout

Respect list timeout overrides in incremental Nostr list fetches
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2026-01-29 11:01:52 -05:00
commit 3ede0bec69
1 file changed
+3 -3
+3 -3
View File
@@ -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`