diff --git a/daily-perf-report-2026-02-17.md b/daily-perf-report-2026-02-17.md index a510ffbd..890a3e93 100644 --- a/daily-perf-report-2026-02-17.md +++ b/daily-perf-report-2026-02-17.md @@ -1,6 +1,6 @@ # Daily Performance Report - 2026-02-17 -**Summary:** Bounded concurrency for DM signal events and DM service initialization to prevent network saturation. +**Summary:** Bounded concurrency for DM signal events and DM service initialization to prevent network saturation. Also fixed a CI failure related to `lint:hex` buffer size. ## Findings & Fixes @@ -10,6 +10,10 @@ - **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 with exit code 1 (and likely `ENOBUFS` internally) because `git grep` outputted large minified file contents that exceeded the default buffer size of `spawnSync`. +- **Fix:** Increased `maxBuffer` in `scripts/check-hex.js` to 10MB. + ### Docs Audit - **Port Alignment:** Verified `content/docs/guides/upload-content.md` correctly specifies port 3000 for CORS, aligning with previous remediation. No changes needed. @@ -18,7 +22,7 @@ - **DM Decrypt Queue:** N/A (network bounding). ## Decisions -- Used `RELAY_BACKGROUND_CONCURRENCY` (3) for DM operations to match relay manager behavior. +- Used `RELAY_BACKGROUND_CONCURRENCY || 3` for DM operations to match relay manager behavior and ensure robustness. ## PRs / Commits -- `perf: bound DM subsystem network concurrency` (this change). +- `perf: bound DM subsystem network concurrency & fix CI lint buffer` diff --git a/docs/agents/task-logs/daily/2026-02-17_07-39-33_perf-agent_completed.md b/docs/agents/task-logs/daily/2026-02-17_07-39-33_perf-agent_completed.md index d956350c..888af0d6 100644 --- a/docs/agents/task-logs/daily/2026-02-17_07-39-33_perf-agent_completed.md +++ b/docs/agents/task-logs/daily/2026-02-17_07-39-33_perf-agent_completed.md @@ -5,16 +5,19 @@ **Goals:** - Identify and fix unbounded concurrency in network operations. - Audit upload documentation. +- Fix CI failures. **Actions:** - **Identified:** Unbounded `Promise.all` usage in `js/nostr/dmSignalEvents.js` and `js/services/dmNostrService.js`. -- **Fixed:** Replaced with `pMap` and `RELAY_BACKGROUND_CONCURRENCY` (3). +- **Fixed:** Replaced with `pMap` and `RELAY_BACKGROUND_CONCURRENCY || 3`. +- **Fixed CI:** Increased `maxBuffer` in `scripts/check-hex.js` to 10MB to prevent `ENOBUFS` when `git grep` matches large minified files. - **Verified:** Documentation in `content/docs/guides/upload-content.md` correctly specifies port 3000. -- **Tested:** Unit and integration tests for DM subsystem passed. +- **Tested:** Unit and integration tests for DM subsystem passed. Lint passed. **Files Changed:** - `js/nostr/dmSignalEvents.js` - `js/services/dmNostrService.js` +- `scripts/check-hex.js` - `daily-perf-report-2026-02-17.md` - Context/Logs: `context/`, `todo/`, `decisions/`, `test_logs/` diff --git a/js/nostr/dmSignalEvents.js b/js/nostr/dmSignalEvents.js index 55f1aba6..23d83442 100644 --- a/js/nostr/dmSignalEvents.js +++ b/js/nostr/dmSignalEvents.js @@ -144,7 +144,7 @@ export async function publishDmReadReceipt( const publishResults = await pMap( relayList, (url) => publishEventToRelay(client.pool, url, signedEvent), - { concurrency: RELAY_BACKGROUND_CONCURRENCY }, + { concurrency: RELAY_BACKGROUND_CONCURRENCY || 3 }, ); const acceptedRelays = publishResults @@ -287,7 +287,7 @@ export async function publishDmTypingIndicator( const publishResults = await pMap( relayList, (url) => publishEventToRelay(client.pool, url, signedEvent), - { concurrency: RELAY_BACKGROUND_CONCURRENCY }, + { concurrency: RELAY_BACKGROUND_CONCURRENCY || 3 }, ); const acceptedRelays = publishResults diff --git a/js/services/dmNostrService.js b/js/services/dmNostrService.js index 6b2113f7..8e02ae51 100644 --- a/js/services/dmNostrService.js +++ b/js/services/dmNostrService.js @@ -279,7 +279,7 @@ class DmNostrService { async (relayUrl) => { await this.connectRelay(relayUrl); }, - { concurrency: RELAY_BACKGROUND_CONCURRENCY }, + { concurrency: RELAY_BACKGROUND_CONCURRENCY || 3 }, ); } @@ -680,7 +680,7 @@ class DmNostrService { return { ...result, relayUrl }; }, - { concurrency: RELAY_BACKGROUND_CONCURRENCY }, + { concurrency: RELAY_BACKGROUND_CONCURRENCY || 3 }, ); return results; diff --git a/scripts/check-hex.js b/scripts/check-hex.js index ee1a56b3..46cf96ad 100755 --- a/scripts/check-hex.js +++ b/scripts/check-hex.js @@ -55,7 +55,8 @@ for (const glob of IGNORED_GLOBS) { // We rely on 'git' being available and 'git grep' supporting -P. // Typically available in most CI/dev environments. -const result = spawnSync('git', gitArgs, { encoding: 'utf8' }); +// Increase maxBuffer to 10MB to prevent ENOBUFS on large minified files +const result = spawnSync('git', gitArgs, { encoding: 'utf8', maxBuffer: 10 * 1024 * 1024 }); if (result.error) { console.error('Failed to execute git grep:', result.error.message);