- Added `js/nostr/nip46Queue.js` to manage concurrent RPC requests.
- Updated `Nip46RpcClient` to serialize outgoing requests, preventing "rate-limited" errors.
- Implemented exponential backoff for retries when relays reject events due to rate limits.
- Added priority levels to `sendRpc` to prioritize user actions (signing, connecting) over background tasks (decrypting).
- Verified with new unit tests in `tests/unit/nip46Queue.test.mjs`.
When a user logs in, `profileCache` emits a `profileChanged` event. Previously, `HashtagPreferencesService` only reset its state on this event, failing to fetch the new user's preferences. This commit updates the subscription handler to call `load(pubkey)` when a new profile is set, ensuring interests and disinterests are reliably synchronized.
- Add fuzz testing scripts for `nostrEventSchemas.js`, `dmDecryptor.js`, and `magnetUtils.js` in `scripts/agent/`.
- Fix `build...` functions in `nostrEventSchemas.js` to handle `null`/`undefined` inputs.
- Fix `buildVideoPostEvent` to gracefully handle circular references in content serialization.
- Fix `normalizeAndAugmentMagnet` in `magnetUtils.js` to handle non-iterable `extraTrackers`.
- Include minimal reproducers for discovered crashes in `examples/reproducers/`.
- Update README.md to recommend `npm ci` and include test steps.
- Update CONTRIBUTING.md with explicit development setup instructions.
- Add `.devcontainer/devcontainer.json` for reproducible Node 20 environment.
- Add audit report in `ai/reports/onboarding-20260118.md`.
Implements `scripts/agent/interop-test.mjs` to validate core Nostr operations
(Video Post, View Event, Encrypted DM) against a small set of public relays.
Ensures ephemeral keys are used and no private data is persisted.
Features:
- Ephemeral sender/receiver key generation.
- Polyfills for WebSocket, localStorage, and Crypto for Node.js environment.
- Verification of event signatures, IDs, and content shape.
- DM encryption/decryption roundtrip verification.
- Safe relay list usage (only 2 known relays).
- Added `scripts/telemetry-aggregator.mjs` to collect, sanitize, and aggregate errors from unit and smoke tests.
- Added `telemetry:aggregate` script to `package.json`.
- Implemented PII sanitization for IPs, emails, and hex keys.
- Configured aggregation to prioritize critical/high severity issues.
- fix `TypeError: Assignment to constant variable` in `HashtagPreferencesService.load` by changing `const` to `let` for `wasLoadedForUser`.
- Prevent existing cached preferences from being wiped when remote decryption fails.
- Adds `STORAGE_KEY_FILTERED_VIDEOS` and `MAX_PERSISTED_VIDEOS` constants.
- Implements `loadPersistedFilteredVideos` and `persistFilteredVideos` helper methods.
- Updates `loadVideos` to load persistent videos optimistically and emit "persistent-cache" updates.
- Ensures all persistent data is strictly re-filtered (blocked authors, NSFW, access control) before use.
- Skips emitting empty in-memory cache updates if optimistic data is available to prevent UI flashing.
- Persists fresh filtered results in `applyAndNotify` to keep cache up-to-date.
- Adds comprehensive verification script logic (tested via `scripts/verify-optimistic-cache.mjs` before cleanup).
Moved torrent status update logic to `js/ui/torrentStatusController.js` to improve separation of concerns as per `AGENTS.md`. The controller accepts a `getVideoModal` accessor and an `onRemovePoster` callback to decouple it from direct `videoModal` or `Application` dependencies. Added unit tests in `tests/ui/torrentStatusController.test.mjs`.