From 3862415340c6c695bbcd3b7d1d19a0d6ecc859d7 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 15:31:06 +0000 Subject: [PATCH] chore(ai): doc js/nostr/client.js (agent) Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- docs/nostr-client-overview.md | 4 ++-- js/nostr/client.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) 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 dd1cc1a5..dd939338 100644 --- a/js/nostr/client.js +++ b/js/nostr/client.js @@ -3881,7 +3881,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). @@ -3889,6 +3889,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. */