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 <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-02-09 01:46:46 +00:00
1 parent 286e676280
commit 31d6730c59
2 files changed
+5

No files matched your search

+2
View File
@@ -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<string, object>}
+3
View File
@@ -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;
}