mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-29 00:42:30 +00:00
perf: bound DM subsystem network concurrency & fix CI lint buffer
- 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. - Increased `maxBuffer` in `scripts/check-hex.js` to 10MB to prevent `ENOBUFS` when git text search matches large minified files in CI. - Verified documentation in `content/docs/guides/upload-content.md` correctly specifies port 3000. - Passed all unit and integration tests. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
799c336bf3
commit
b8832dcae8
5 files changed
+18
-10
No files matched your search
@@ -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`
|
||||
@@ -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/`
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user