From 31d6730c5952b9b2b33e925d39bccdb36eab6989 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 9 Feb 2026 01:46:46 +0000 Subject: [PATCH] Refactor fetchListIncrementally to use RelayBatchFetcher This change completes the refactoring of `fetchListIncrementally` by: 1. Importing `RelayBatchFetcher` in `js/nostr/client.js`. 2. Instantiating `RelayBatchFetcher` in `NostrClient` constructor. 3. Ensuring `RelayBatchFetcher` receives the client instance. The complex logic was already moved to `js/nostr/relayBatchFetcher.js`, but the integration was missing, causing runtime errors. This change fixes the wiring and ensures the new class is used. Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- js/nostr/client.js | 2 ++ js/nostr/relayBatchFetcher.js | 3 +++ 2 files changed, 5 insertions(+) diff --git a/js/nostr/client.js b/js/nostr/client.js index 1084c6ac..b076fc92 100644 --- a/js/nostr/client.js +++ b/js/nostr/client.js @@ -215,6 +215,7 @@ import { EventsMap } from "./eventsMap.js"; import { PersistenceManager } from "./managers/PersistenceManager.js"; import { ConnectionManager } from "./managers/ConnectionManager.js"; import { SignerManager } from "./managers/SignerManager.js"; +import { RelayBatchFetcher } from "./relayBatchFetcher.js"; function normalizeProfileFromEvent(event) { if (!event || !event.content) return null; @@ -580,6 +581,7 @@ export class NostrClient { constructor() { this.connectionManager = new ConnectionManager(this); this.signerManager = new SignerManager(this); + this.relayBatchFetcher = new RelayBatchFetcher(this); /** * @type {Map} diff --git a/js/nostr/relayBatchFetcher.js b/js/nostr/relayBatchFetcher.js index 7afe346e..5fdf0910 100644 --- a/js/nostr/relayBatchFetcher.js +++ b/js/nostr/relayBatchFetcher.js @@ -5,6 +5,9 @@ import { normalizeNostrPubkey, sanitizeRelayList } from "./nip46Client.js"; import { DEFAULT_RELAY_URLS, RELAY_URLS } from "./toolkit.js"; export class RelayBatchFetcher { + /** + * @param {import("./client.js").NostrClient} client + */ constructor(client) { this.client = client; }