diff --git a/docs/nostr-client-overview.md b/docs/nostr-client-overview.md index bdb392ab..cf4407bc 100644 --- a/docs/nostr-client-overview.md +++ b/docs/nostr-client-overview.md @@ -20,7 +20,7 @@ The client maintains three primary state maps to ensure data consistency: * **`activeMap`** (`Map`): * The "materialized view" used by the UI. - * Keys are `videoRootId` (for versioned edits) or `pubkey:dTag` (for addressable events). + * Keys are `videoRootId` (prefixed with `ROOT:`) for versioned edits, or `pubkey:dTag` for addressable events. * Values are the *latest* valid version of the video. * **Invariant**: Only one entry exists per "video entity", ensuring the UI displays the most recent edit. @@ -36,7 +36,7 @@ The `subscribeVideos` method implements a buffered ingestion pipeline to handle 1. **Subscription**: Opens a subscription to all connected relays. 2. **Buffering**: Incoming events are pushed to an `eventBuffer` array immediately. -3. **Debouncing**: A timer flushes the buffer every ~250ms (or when full). +3. **Debouncing**: A timer flushes the buffer every ~75ms (or when full). 4. **Processing (Flush)**: * Events are parsed and validated. * **Tombstone Check**: If an event predates a known deletion, it is discarded. diff --git a/js/nostr/client.js b/js/nostr/client.js index c8a1159c..d338abe9 100644 --- a/js/nostr/client.js +++ b/js/nostr/client.js @@ -3885,7 +3885,7 @@ export class NostrClient { * - Updates the `SyncMetadataStore` with the new max `created_at` on success. * * **Concurrency:** - * - Batches relay requests in chunks of 4 to avoid saturating network connections. + * - Batches relay requests in chunks of 8 to avoid saturating network connections. * * @param {object} params * @param {number} params.kind - The event kind to fetch (e.g. 10000 for mute list). @@ -3893,6 +3893,7 @@ export class NostrClient { * @param {string} [params.dTag] - Optional d-tag for addressable events (NIP-33). * @param {string[]} [params.relayUrls] - List of relays to query. Defaults to client's configured relays. * @param {function} [params.fetchFn] - Custom fetch function (mocks or specialized logic). Defaults to `pool.list`. + * @param {number} [params.since] - Explicit start timestamp (overrides storage). * @param {number} [params.timeoutMs] - Optional per-relay timeout for list fetches; defaults to a higher list-friendly baseline. * @returns {Promise} Deduplicated list of events found across all relays. */ diff --git a/tests/app-batch-fetch-profiles.test.mjs b/tests/app-batch-fetch-profiles.test.mjs index 4a4863b8..69cb9933 100644 --- a/tests/app-batch-fetch-profiles.test.mjs +++ b/tests/app-batch-fetch-profiles.test.mjs @@ -99,7 +99,6 @@ test("batchFetchProfiles handles fast and failing relays", async () => { nostrClient.relays = originalRelays; nostrClient.readRelays = originalReadRelays; nostrClient.writeRelays = originalWriteRelays; - nostrClient.readRelays = originalReadRelays; nostrClient.pool = originalPool; }