Commit Graph
1918 Commits
Author SHA1 Message Date
thePR0M3TH3AN ee3923f169 Update DM focus on default selection 2026-02-01 12:57:04 -05:00
thePR0M3TH3AN b1418d02e5 Render DM threads before profile hydration 2026-02-01 12:36:16 -05:00
thePR0M3TH3AN 83dd3a9738 Add magnet webseeds to torrent fallback 2026-02-01 12:23:02 -05:00
thePR0M3TH3AN cf3631c4c8 Use peer counts in probePeers timeout 2026-02-01 12:19:55 -05:00
thePR0M3TH3AN 429df6e205 Handle webseed-only probe results 2026-02-01 12:14:35 -05:00
thePR0M3TH3AN b802867f93 Fix nostr cache persistence snapshot 2026-02-01 12:06:22 -05:00
thePR0M3TH3AN 1fc9859798 Merge branch 'unstable' into ai/performance-events-cache-dirty-tracking-5412442767823742174 2026-02-01 12:00:52 -05:00
thePR0M3TH3AN 43a977da61 Merge branch 'unstable' into ai/optimize-events-cache-persistence-7314295839012727690 2026-02-01 11:59:25 -05:00
thePR0M3TH3AN be7137c447 Merge branch 'unstable' into ai/docs-alignment-14321450681939854377 2026-02-01 11:58:57 -05:00
google-labs-jules[bot]andPR0M3TH3AN c82ab2d490 Optimize EventsCacheStore persistence with dirty state tracking
Implemented `dirtyEventIds` and `dirtyTombstones` in `NostrClient` to track only modified items.
Updated `EventsCacheStore.persistSnapshot` to accept these dirty sets and iterate only over changed items, skipping the O(N) serialization loop for unchanged data.
Added heuristic to skip deletion scan if the dataset size has not decreased.
Optimized `NostrClient` methods (`flushEventBuffer`, `deleteAllVersions`, `fetchVideos`, etc.) to flag modified events.
Updated `nostr-delete-flow.test.mjs` to use valid hex IDs for NIP-compliant testing.

Benchmark results (5000 items, single update):
- Before: ~19ms (O(N))
- After: ~2ms (O(1))

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 16:50:28 +00:00
google-labs-jules[bot]andPR0M3TH3AN ac23475b4a fix(ci): instrument webtorrent logic to debug flaky regression test
- Add detailed logging inside `js/webtorrent.js` (guarded by `NODE_ENV=test`) to inspect the state of `peers`, `hasWebSeed`, and `webseedOnly` when a probe times out.
- This is intended to diagnose why `webseedOnly` evaluates to false in CI despite logs indicating `hasExplicitWebSeed` is true.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 16:25:04 +00:00
google-labs-jules[bot]andPR0M3TH3AN 80dd5dcade fix(test): add debug logging and increase timeout in webtorrent regression test
- Increase `timeoutMs` in `tests/webtorrent-regression.test.mjs` from 50ms to 200ms to reduce flakiness in CI environments.
- Add debug logging to `js/webtorrent.js` (guarded by `NODE_ENV === 'test'`) to inspect `probePeers` inputs and `client.add` errors, helping diagnose why `webseedOnly` detection might fail in CI.
- Log failure details in `tests/webtorrent-regression.test.mjs` if assertion fails.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 16:19:16 +00:00
google-labs-jules[bot]andPR0M3TH3AN 912bf85499 optimize: track dirty events to speed up cache persistence
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 16:11:57 +00:00
thePR0M3TH3AN 3118773621 Add explicit web seeds to torrent streams 2026-02-01 11:05:30 -05:00
thePR0M3TH3AN e022f0f633 Handle web seed peers in torrent probe 2026-02-01 11:03:19 -05:00
thePR0M3TH3AN f66e98f969 Merge pull request #2040 from PR0M3TH3AN/ai/fix-webseed-health-and-bootstrap-1140772652148172709
Fix WebTorrent webseed health check and bootstrap behavior
2026-02-01 10:52:02 -05:00
google-labs-jules[bot]andPR0M3TH3AN 7e21386bd0 fix(webtorrent): correct webseed availability check and force bootstrap
This change addresses two issues with WebTorrent webseed handling:
1.  **Grid Availability Check:** Modified `js/gridHealth.js` to correctly classify torrents with only webseeds as "healthy" and report 1 peer (instead of 0) so the UI availability check passes.
2.  **Video Player Bootstrap:** Modified `js/webtorrent.js` (`probePeers` and `streamVideo`) to explicitly append provided webseed URLs (`urlList`) to the magnet link as `&ws=` parameters. This forces the WebTorrent client to recognize and use these webseeds as initial peers for bootstrapping the swarm.

Tested via `tests/verification/verify_webseed_fix.mjs` (logic verification).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 15:49:46 +00:00
google-labs-jules[bot]andPR0M3TH3AN 77cd03b2f7 Refactor DM loading to be opportunistic and serialize notification updates
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 15:47:54 +00:00
thePR0M3TH3AN 5a67774011 Merge pull request #2023 from PR0M3TH3AN/fix-webtorrent-webseed-regression-10274894627332192935
Fix WebTorrent webseed stream health check regression
2026-02-01 09:14:43 -05:00
google-labs-jules[bot]andPR0M3TH3AN 2f33992192 Fix dependencies (jsdom/nostr-tools conflict) and WebTorrent regression
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 13:32:00 +00:00
thePR0M3TH3AN 438f895dd6 Merge branch 'unstable' into fix-webtorrent-webseed-regression-10274894627332192935 2026-02-01 08:00:23 -05:00
google-labs-jules[bot]andPR0M3TH3AN 1dfc23c11a refactor(ai): extract notification logic from js/app.js (agent)
- Moved `showError`, `showStatus`, `showSuccess`, and `updateNotificationPortalVisibility` logic to `js/ui/notificationController.js`.
- Instantiated `NotificationController` in `js/ui/applicationBootstrap.js`.
- Refactored `js/app.js` to delegate notification calls to the controller.
- Added unit tests for `NotificationController`.
- Followed AGENTS.md refactoring checklist.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 03:08:05 +00:00
google-labs-jules[bot]andPR0M3TH3AN ffd8f0e23c fix: Sync package-lock.json and fix tests for nostr-tools v2
- Synced `package-lock.json` with `package.json` to resolve `npm ci` failures.
- Updated `nostr-tools` dependencies to resolve conflicts.
- Fixed `SyntaxError` in `tests/nostr-login-permissions.test.mjs` caused by duplicate code.
- Updated `js/nostr/client.js`, `js/nostr/publishHelpers.js`, `js/nostr/adapters/nsecAdapter.js`, `js/nostr/nip46Client.js` to use `hexToBytes` helper when calling `nostr-tools` functions, as v2+ expects `Uint8Array` instead of hex strings.
- Added `hexToBytes` helper in `js/utils/hex.js`.
- Updated tests (`tests/nostr/dm-direct-message-flow.test.mjs`, `tests/nostr-send-direct-message.test.mjs`, `tests/nostr-private-key-signer.test.mjs`, `tests/nostr/nip46Client.test.js`) to use `Uint8Array` for keys where required.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 19:56:44 +00:00
google-labs-jules[bot]andPR0M3TH3AN 5a5772de3a perf: Batch NIP-71 metadata fetches in NostrClient
Currently, when the NostrClient processes a burst of video events (e.g., initial
feed load), it triggers an individual NIP-71 metadata fetch for every video that
updates the `activeMap`. This results in a stampede of network requests (N videos
* M relays).

This change optimizes `flushEventBuffer` to collect all videos requiring metadata
updates and executes a single batched `populateNip71MetadataForVideos` call at
the end of the flush cycle.

This reduces the metadata fetch overhead from O(N) to O(1) per batch.

Verified with a local benchmark script (reduced fetch calls from 50 to 1 for 50 events)
and existing unit tests.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 19:36:08 +00:00
google-labs-jules[bot]andPR0M3TH3AN 9aaf8aa4d5 fix(webtorrent): ensure webseed-only streams are marked healthy
Previously, `probePeers` would mark a stream as unhealthy (healthy: false) if no P2P peers were found, even if a valid webseed was present. This caused the UI to potentially disable playback or show error states for webseed-only content.

This fix ensures that if `peers === 0` but `hasWebSeed` is true, the probe result returns `healthy: true` with reason `"webseed"`.

Added `tests/webtorrent-regression.test.mjs` to verify this behavior and prevent future regressions.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 19:07:31 +00:00
thePR0M3TH3AN daa9161f96 Merge branch 'unstable' into agent/automated-pr-review-fixes-3637557005884121646 2026-01-31 13:48:46 -05:00
thePR0M3TH3AN 66f41b56a1 Merge pull request #2018 from PR0M3TH3AN/ai/dead-code-20241024-16967779679149472382
Dead Code Sweep: Remove orphaned tracker config and signing adapter
2026-01-31 13:47:52 -05:00
thePR0M3TH3AN f58b9f709e Merge branch 'unstable' into ai/deps-safe-upgrades-3374834892089585189 2026-01-31 13:46:34 -05:00
thePR0M3TH3AN 47fde8dd84 Merge branch 'unstable' into ai/schema-validate-20250226-13203498180481473459 2026-01-31 13:40:52 -05:00
google-labs-jules[bot]andPR0M3TH3AN f0606065c9 fix(ai): resolve test failures and permission regressions (agent)
- Fix flaky mock in `tests/hashtag-preferences.test.mjs` (limit mock responses to avoid timeouts)
- Fix timeout leak in `js/services/hashtagPreferencesService.js` (clear timeout on success)
- Update `nostrClient.loginWithExtension` to request full permissions (fixing `nostr-login-permissions.test.mjs`)
- Ensure `jsdom` is available for `channel-profile-moderation.test.mjs`

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 15:53:38 +00:00
google-labs-jules[bot]andPR0M3TH3AN 76a90a1a62 chore(ai): safe dependency upgrades and test fixes
- Upgrade playwright to 1.58.1 and autoprefixer to 10.4.24
- Fix permission caching in client.js
- Improve test robustness for hashtag preferences
- Add dependency scan artifacts
- Document deferred upgrades

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 15:46:06 +00:00
google-labs-jules[bot]andPR0M3TH3AN 5232f38bed fix(ai): resolve test failures and permission regressions (agent)
- Fix flaky mock in `tests/hashtag-preferences.test.mjs`
- Update `nostrClient.loginWithExtension` to request full permissions (fixing `nostr-login-permissions.test.mjs`)
- Ensure `jsdom` is available for `channel-profile-moderation.test.mjs`

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 15:30:15 +00:00
thePR0M3TH3AN cffbe26c04 Merge pull request #2007 from PR0M3TH3AN/ai/refactor-profile-modal-20231026-3866161108178541875
Refactor handleAddProfile to ProfileModalController
2026-01-31 10:18:13 -05:00
google-labs-jules[bot]andPR0M3TH3AN 56d9465165 chore(ai): remove dead code (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 14:58:50 +00:00
google-labs-jules[bot]andPR0M3TH3AN 2c87b94b62 fix(tests): resolve hashtag preferences unit test failure
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 09:50:04 +00:00
google-labs-jules[bot]andPR0M3TH3AN 9d829f548b fix(nostr): request encryption permissions during extension login
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 09:32:02 +00:00
google-labs-jules[bot]andPR0M3TH3AN eeb3283344 fix(ci): prevent signer hangs in tests and background services
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 08:14:53 +00:00
google-labs-jules[bot]andPR0M3TH3AN a920032993 fix(ci): prevent signer timeouts in background tests
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 07:14:47 +00:00
google-labs-jules[bot]andPR0M3TH3AN ce8c5931e5 chore(ai): event schema validation tool + fixes
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 06:53:22 +00:00
google-labs-jules[bot]andPR0M3TH3AN f5e16f296e refactor(ai): extract handleAddProfile from js/app.js (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 03:55:51 +00:00
google-labs-jules[bot]andPR0M3TH3AN 51087fad7e refactor(ai): extract handleAddProfile from js/app.js (agent)
Moves `handleAddProfile` logic from the main application class into `ProfileModalController` to improve separation of concerns as per `AGENTS.md`.

- Extracts `handleAddProfile` to `js/ui/profileModalController.js`.
- Updates `ProfileModalController` to handle add account flow internally.
- Removes legacy callback wiring from `js/app.js` and `js/ui/applicationBootstrap.js`.
- Adds unit tests for the extracted logic in `tests/ui/profileModalController-addProfile.test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 03:32:52 +00:00
google-labs-jules[bot]andPR0M3TH3AN e027e6bba3 chore(ai): CI health fixes (flaky tests)
- Fix flaky `tests/hashtag-preferences.test.mjs` by correcting mock implementation for `fetchListIncrementally`.
- Fix `tests/nostr-login-permissions.test.mjs` failure by requesting correct permissions in `js/nostr/client.js`.
- Fix 90s timeout in `HashtagPreferencesService` by clearing the timeout timer upon successful decryption.
- `npm install` was run to ensure dependencies like `jsdom` are present for `tests/app/channel-profile-moderation.test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 03:08:33 +00:00
thePR0M3TH3AN 00899694b5 Revert "Fix ignored webseeds in magnet links" 2026-01-30 17:04:15 -05:00
google-labs-jules[bot]andPR0M3TH3AN 2bebaa6465 fix(webtorrent): ensure magnet webseeds are used in stream
Extracts `ws` (web seed) parameters from the magnet link and merges them with the explicit `urlList` (e.g., from direct URL) when initializing the WebTorrent stream. This fixes a regression where magnet-embedded web seeds were ignored if a direct URL was provided.

- Updates `js/magnets.js` to parse `ws` parameters and export `webSeedsFromMagnet`.
- Updates `js/webtorrent.js` to merge magnet web seeds with `opts.urlList`.
- Adds regression test `tests/webtorrent-webseeds.test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 22:01:13 +00:00
thePR0M3TH3AN ceccd34681 Revert "Dead Code Cleanup" 2026-01-30 16:51:01 -05:00
thePR0M3TH3AN e77f5f3636 Defer NIP-07 permission prompts 2026-01-30 16:28:00 -05:00
thePR0M3TH3AN a5c7d3d496 Merge pull request #1995 from PR0M3TH3AN/codex/add-allowpermissionprompt-option-to-loadblocks
Defer block list permission prompts during login
2026-01-30 16:04:03 -05:00
thePR0M3TH3AN 94e92acc68 Merge pull request #1996 from PR0M3TH3AN/ai/dead-code-cleanup-34771678735083742
Dead Code Cleanup
2026-01-30 16:00:28 -05:00
google-labs-jules[bot]andPR0M3TH3AN 60fa6c4282 chore(ai): remove dead code (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 20:54:52 +00:00
thePR0M3TH3AN 7ef420e1e2 Defer block list permission prompts during login 2026-01-30 15:53:57 -05:00