Files
bitvid/daily-perf-report-2026-02-17.md
T
google-labs-jules[bot]andPR0M3TH3AN f1c83534d6 perf: bound DM subsystem network concurrency & fix CI lint/tests
- Replaced unbounded `Promise.all` with `pMap` and `RELAY_BACKGROUND_CONCURRENCY || 3` in `js/nostr/dmSignalEvents.js` and `js/services/dmNostrService.js` to prevent network saturation.
- Updated `scripts/check-hex.js` to exclude agent artifact directories (`perf/`, `test_logs/`, `context/`, etc.) to prevent lint failures when agents log code snippets or hex codes.
- Increased `maxBuffer` in `scripts/check-hex.js` to 10MB to be robust against large matches.
- Updated `js/services/exploreDataService.js` to trigger immediate data refresh (`refreshWatchHistoryTagCounts` and `refreshTagIdf`) when visibility state changes to visible, fixing a unit test failure.
- Includes daily performance report and context logs.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 15:08:13 +00:00

2.2 KiB

Daily Performance Report - 2026-02-17

Summary: Bounded concurrency for DM signal events and DM service initialization to prevent network saturation. Fixed CI failure in lint:hex and unit-tests.

Findings & Fixes

P0: Unbounded Concurrency in DM Subsystem

  • Files: js/nostr/dmSignalEvents.js, js/services/dmNostrService.js
  • Impact: Promise.all was used to map over all relays (potential for 20+ connections simultaneously) for DM read receipts, typing indicators, and service connections.
  • Fix: Replaced with pMap using RELAY_BACKGROUND_CONCURRENCY || 3.
  • Verification: npm run test:dm:unit and npm run test:dm:integration passed.

CI Failure (lint:hex)

  • Problem: The npm run lint:hex script failed in CI because git grep scanned perf/hits-2026-02-17.txt (which contained a dump of webtorrent.min.js from an agent search) and found hex codes, treating it as a violation.
  • Fix: Updated scripts/check-hex.js to exclude agent artifact directories (perf/, test_logs/, context/, decisions/, todo/).
  • Additional Fix: Increased maxBuffer in scripts/check-hex.js to 10MB to be robust against large matches.

CI Failure (unit-tests)

  • Problem: tests/unit/services/exploreDataService.test.mjs failed with 0 !== 1 for "visibility change triggers refresh". The test expected an immediate data refresh when document.hidden changed to false, but the implementation only started the interval timer.
  • Fix: Updated handleVisibility in js/services/exploreDataService.js to trigger refreshWatchHistoryTagCounts and refreshTagIdf immediately when becoming visible.

Docs Audit

  • Port Alignment: Verified content/docs/guides/upload-content.md correctly specifies port 3000 for CORS, aligning with previous remediation. No changes needed.

Metrics

  • Login Time: N/A (change affects background network tasks).
  • DM Decrypt Queue: N/A (network bounding).

Decisions

  • Used RELAY_BACKGROUND_CONCURRENCY || 3 for DM operations to match relay manager behavior and ensure robustness against missing constants.

PRs / Commits

  • perf: bound DM subsystem network concurrency & fix CI lint/tests