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]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-02-18 15:08:13 +00:00
1 parent 91ec9b32c5
commit f1c83534d6
130 files changed
+5831 -7557

No files matched your search

-28
View File
@@ -1,28 +0,0 @@
# Decompose: js/ui/profileModalController.js
## Selection
Selected `js/ui/profileModalController.js` (6258 lines) because it is the largest grandfathered file not decomposed in the last 8 weeks.
## Plan
Extract two cohesive blocks related to DM functionality that are currently mixed into the main controller:
1. **DM Relay UI Logic** (`ProfileDmRelayBinder.js`)
- `cacheDmRelayElements`
- `bindDmRelayControls`
- `refreshDmRelayPreferences`
- `handlePublishDmRelayPreferences`
- `updateDmPrivacyToggleForRecipient`
- `setPrivacyToggleState`
- `handleActiveDmIdentityChanged`
2. **DM Attachment Logic** (`ProfileDmAttachmentBinder.js`)
- `renderAttachmentQueue`
- `uploadAttachmentQueue`
- `resolveLatestDirectMessageForRecipient`
- `maybePublishTypingIndicator`
These functions heavily rely on `this.dmController` and `this.services`, suggesting they belong in dedicated helpers or the DM controller itself. Extracting them to binder modules allows preserving the `this` context via argument passing while reducing the main file size.
## Stats
- Original size: 6258 lines
- Target reduction: > 200 lines
-5
View File
@@ -1,5 +0,0 @@
# Context: Daily Perf Agent Run
Goal: Identify and fix performance issues (P0/P1) and audit upload docs.
Scope: js/ codebase, specifically setInterval/raf loops and upload logic.
DoD: One small fix applied, docs verified, report generated.
-13
View File
@@ -1,13 +0,0 @@
# Context: Daily Performance & Docs Audit - 2026-02-15
## Goal
Improve app responsiveness and ensure documentation accuracy regarding upload/contribution.
## Scope
- Identify performance bottlenecks (CPU/Network).
- Audit `content/` docs against `js/` implementation.
- Apply small, safe fixes.
## Assumptions
- We are on `unstable` branch (implied by agent prompt, though I should check).
- Node.js environment is ready.
@@ -1,18 +0,0 @@
# Context: Explore Data Service Performance Optimization
**Goal**: Reduce background CPU and battery usage by pausing `ExploreDataService` updates when the tab is hidden.
**Scope**:
- `js/services/exploreDataService.js`
**Problem**:
- The service runs two `setInterval` timers (1 minute and 5 minutes) to refresh watch history counts and tag IDF.
- These run even when the tab is hidden or minimized, consuming resources unnecessarily.
**Proposed Solution**:
- Modify the interval callbacks to check `document.hidden`. If true, skip the update.
- Add a `visibilitychange` listener to trigger an immediate update when the tab becomes visible (if the data is stale).
**Assumptions**:
- `document.hidden` is supported in target browsers (modern browsers support it).
- Users do not need real-time updates for "explore" data when the tab is not visible.
-22
View File
@@ -1,22 +0,0 @@
# Context: Content Audit & Bug Fix
**Agent:** content-audit-agent
**Date:** 2026-02-18
**Goal:** Audit `content/docs/guides/upload-content.md` against codebase. Fix identified bug in NIP-71 hashtag handling.
## Scope
- `content/docs/guides/upload-content.md`
- `js/services/videoNotePayload.js`
- `js/ui/components/UploadModal.js`
- `components/upload-modal.html`
## Identified Issue
Hashtags entered in the Upload Modal are collected as `{ t: [...] }` by `Nip71FormManager` (due to `data-nip71-list="t"`).
However, `videoNotePayload.js`'s `normalizeNip71Metadata` only looks for `rawMetadata.hashtags`.
This causes user-entered hashtags to be dropped during payload construction.
## Plan
1. Inventory and verify all claims in `upload-content.md`.
2. Create a unit test to reproduce the hashtag bug.
3. Fix the bug in `videoNotePayload.js` to support `t` alias.
4. Verify fix with tests.
-1
View File
@@ -1 +0,0 @@
# Context for Constants Refactor\n\nTimestamp: 20260217_205312\nBranch: unstable\nCommit: 65d82e578faf6c46ee7d2b6c61d93105c6f4c855\nNode: v22.22.0\nNPM: 11.7.0\n\nGoal: Find duplicated numeric constants in js/ and replace with canonical definitions.