Commit Graph
4062 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN e5f24bf4b0 refactor(ai): extract handleRevertVideo from js/app.js (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-27 03:20:08 +00:00
thePR0M3TH3AN 2fd0d5cab6 Merge pull request #1776 from PR0M3TH3AN/codex/add-required-storage-pointer-tag-for-video-publishing
Add storage pointer tag and info.json resolution for published videos
2026-01-26 22:07:46 -05:00
thePR0M3TH3AN 419a3f419c Add storage pointer tags to video posts 2026-01-26 22:07:32 -05:00
thePR0M3TH3AN 91b45abf9a Merge pull request #1775 from PR0M3TH3AN/ai/ci-health-20250218-16125694416550655226
chore(ai): CI health fixes (flaky tests)
2026-01-26 22:01:25 -05:00
google-labs-jules[bot]andPR0M3TH3AN 38dc140a46 chore(ai): CI health fixes (flaky tests)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-27 02:59:39 +00:00
thePR0M3TH3AN da5b1107d7 Merge pull request #1774 from PR0M3TH3AN/codex/add-helper-to-extract-btih-from-magnets
Add BTIH extraction helper and normalize infohash handling
2026-01-26 21:49:38 -05:00
thePR0M3TH3AN 50793430a8 Add btih extraction helper 2026-01-26 21:49:18 -05:00
thePR0M3TH3AN 0897106c2e Merge pull request #1773 from PR0M3TH3AN/codex/reorder-upload-flow-in-uploadmodal
Compute upload identifier before building storage keys
2026-01-26 21:43:53 -05:00
thePR0M3TH3AN ee31e4318a Compute upload identifiers before building R2 keys 2026-01-26 21:43:39 -05:00
thePR0M3TH3AN 0fe782c1d1 Merge pull request #1772 from PR0M3TH3AN/fix/dm-test-timeout-7609659014089825088
Fix DM flow test timeouts and hangs
2026-01-26 21:43:24 -05:00
thePR0M3TH3AN ca46715006 Merge branch 'unstable' into fix/dm-test-timeout-7609659014089825088 2026-01-26 21:43:16 -05:00
google-labs-jules[bot]andPR0M3TH3AN ddcc777561 fix(test): resolve DM flow test timeouts and hangs
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-27 02:42:31 +00:00
thePR0M3TH3AN 8019a27a85 Merge pull request #1771 from PR0M3TH3AN/fix-dm-test-hang-725058605470782070
fix(storage): close IndexedDB connection in directMessagesStore to prevent test hangs
2026-01-26 21:17:49 -05:00
google-labs-jules[bot]andPR0M3TH3AN 5a9452380a fix(storage): close IndexedDB connection after operations in directMessagesStore
Ensures `db.close()` is called in `js/directMessagesStore.js` methods (`loadDirectMessageSnapshot`, `saveDirectMessageSnapshot`, `clearDirectMessageSnapshot`) to prevent hanging `deleteDatabase` calls in tests (and potentially in app teardown). This resolves the timeout issue in `tests/nostr/dm-direct-message-flow.test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-27 02:17:18 +00:00
thePR0M3TH3AN c38f96e787 Merge pull request #1770 from PR0M3TH3AN/fix-test-failures-modal-polyfill-10908485332224060753
Fix video modal test failures (polyfills & selector update)
2026-01-26 21:10:53 -05:00
google-labs-jules[bot]andPR0M3TH3AN ecd59b616b test: fix video modal tests and add missing polyfills
- Added `scrollTo`, `HTMLMediaElement.prototype.pause`, and `load` polyfills in `tests/video-modal-accessibility.test.mjs` (via `setupModal`) and `tests/test-setup.mjs`.
- Added defensive check in `ModalManager.teardown` to prevent `TypeError` when removing event listeners.
- Updated `tests/video-modal-moderation.test.mjs` to use correct selector `[data-moderation-bar]` and updated assertions for moderation overlay visibility (override state).
- Created `tests/test-setup.mjs` to handle early global polyfills for dependencies like `floating-ui`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-27 02:09:22 +00:00
thePR0M3TH3AN 01a75760e0 Merge pull request #1769 from PR0M3TH3AN/fix-jsdom-api-errors-5955605765080797498
Fix JSDOM API errors and comment tests assertions
2026-01-26 21:04:25 -05:00
google-labs-jules[bot]andPR0M3TH3AN 8f440c0acb test(infra): mock web APIs for JSDOM and fix comments test assertions
- Mock HTMLMediaElement.prototype.pause/load and window.scrollTo in test setup to prevent JSDOM "Not implemented" errors.
- Fix VideoModal mock in comments tests to preserve prototype chain (using Object.create instead of spread).
- Add missing childrenByParent map to comments test payloads to fix rendering assertions.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-27 02:04:04 +00:00
thePR0M3TH3AN 3b1fa83e84 Merge pull request #1768 from PR0M3TH3AN/fix-visual-regression-sidebar-timeout-15784207094360655033
Fix visual regression tests and sidebar toggle race condition
2026-01-26 21:03:22 -05:00
google-labs-jules[bot]andPR0M3TH3AN 6eccb03e35 fix(visual): update baselines and fix sidebar toggle timeout (agent)
- Updated visual baselines for `kitchen-sink.spec.ts` to resolve mobile video modal regression.
- Fixed race condition in `overlay-layers.spec.ts` by waiting for `data-state` attribute on sidebar toggle before clicking.
- Ensured CSS build artifacts are present for visual tests.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-27 02:02:04 +00:00
thePR0M3TH3AN 8e6257881d Merge pull request #1767 from PR0M3TH3AN/fix-hashtag-preferences-tests-17099357198215385317
Fix HashtagPreferencesService test failures due to missing signer
2026-01-26 20:43:59 -05:00
google-labs-jules[bot]andPR0M3TH3AN 5a640dd3d8 test(HashtagPreferences): mock signer in beforeEach to fix auto-save errors (agent)
- Update `tests/hashtag-preferences.test.mjs` to set a default mock signer in `beforeEach`.
- Mock `nostrClient.pool.publish` and `nostrClient.writeRelays` to support auto-save operations during tests.
- Revert inline mocks in individual tests to rely on the suite-wide setup.
- Ensure all tests have a valid active pubkey loaded to pass publish validation.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-27 01:27:41 +00:00
thePR0M3TH3AN ba54c0c51c Merge pull request #1766 from PR0M3TH3AN/ai/todo-triage-20250212-6305765269381223539
chore(ai): triage TODOs and generate issue artifacts
2026-01-26 20:18:13 -05:00
google-labs-jules[bot]andPR0M3TH3AN f29e57d17d chore(ai): triage TODOs and generate issue artifacts
Scanned the repository for TODO/FIXME/XXX comments.
Found no trivial fixes in source code.
Identified flaky tests in `tests/visual/moderation.spec.ts` requiring investigation.
Generated `artifacts/todos.txt` and `artifacts/issues_to_create.md`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-27 01:17:47 +00:00
thePR0M3TH3AN acb794abc1 Merge pull request #1765 from PR0M3TH3AN/fix/moderation-webtorrent-logs-16913682428176192873
fix(core): optimize subscriptions, fix memory leak, and quiet logs
2026-01-26 20:16:46 -05:00
thePR0M3TH3AN 35e03f5e0c Merge pull request #1764 from PR0M3TH3AN/agent-pr-review-tool-13509557765094765731
Add automated PR review script (agent)
2026-01-26 20:16:29 -05:00
google-labs-jules[bot]andPR0M3TH3AN fd4318c2f9 fix(core): optimize moderation subscriptions and reduce log noise (agent)
- Refactor `ModerationService` to use batched subscriptions for trusted mute lists, reducing relay load.
- Fix `WebTorrent` memory leak by setting `setMaxListeners(0)` on client instances.
- Suppress "Failed to connect to relay" warnings in `countDiagnostics.js`.
- Degrade benign DM sync errors (e.g. "no-decryptors") to info/debug logs in `profileModalController.js`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-26 23:40:59 +00:00
google-labs-jules[bot]andPR0M3TH3AN 63dec7551d feat(agent): add automated-pr-review script (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-26 23:38:15 +00:00
thePR0M3TH3AN b38517b4f2 Merge pull request #1763 from PR0M3TH3AN/refactor-nip07-adapter-dynamic-13578127844388540104
Refactor NIP-07 adapter for robust extension handling
2026-01-26 18:24:27 -05:00
google-labs-jules[bot]andPR0M3TH3AN fa348e7e00 refactor(nip07): make adapter dynamic to handle extension updates
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-26 23:23:59 +00:00
thePR0M3TH3AN a58c31e2ab Merge pull request #1762 from PR0M3TH3AN/fix-moderation-service-loop-14484125146583454118
fix(services): resolve infinite subscription loop in moderationService
2026-01-26 18:11:22 -05:00
google-labs-jules[bot]andPR0M3TH3AN d48847aa5a fix(services): resolve infinite subscription loop in moderationService
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-26 22:24:04 +00:00
thePR0M3TH3AN fe4042e8cc Merge pull request #1761 from PR0M3TH3AN/refactor-auth-fetch-optimizations-13034258662514235848
Refactor NIP-07 auth and optimize list fetching
2026-01-26 17:13:11 -05:00
google-labs-jules[bot]andPR0M3TH3AN 3c7a396da9 refactor(auth): decouple NIP-07 logic and optimize list fetching (agent)
- Moved NIP-07 extension detection and permission logic from `NostrClient` to `nip07` provider.
- Removed redundant `login` method from `NostrClient`.
- Increased concurrency and added timeouts to `fetchListIncrementally` to prevent hanging on slow relays.
- Updated `UserBlocks` to force full fetch on cache miss, fixing "empty list" issues.
- Updated unit tests for login permissions and hashtag preferences to reflect architectural changes.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-26 21:48:52 +00:00
thePR0M3TH3AN e4be00f08c Merge pull request #1760 from PR0M3TH3AN/ai/smoke-tests-20260126-6251151013796436239
chore(ai): add smoke test script (agent)
2026-01-26 16:35:26 -05:00
google-labs-jules[bot]andPR0M3TH3AN b7e69d3967 chore(ai): add smoke test script (agent)
- Added `scripts/agent/smoke-test.mjs` to verify key flows:
  - Infrastructure: Local Relay (ws://localhost:8899) and Web Server (http://localhost:3000).
  - Protocol: Login, Video Post, View Event, DM Send/Decrypt.
  - UI: Headless Browser (Playwright) screenshot.
- Utilizes `scripts/agent/simple-relay.mjs` for a lightweight relay.
- Uses `scripts/agent/setup-test-env.js` for Node.js polyfills.
- Generates artifacts in `artifacts/` (log, summary JSON, screenshot).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-26 21:29:46 +00:00
thePR0M3TH3AN 967bb079f5 Merge pull request #1759 from PR0M3TH3AN/fix/nostr-login-race-condition-13189586627655219255
Fix race condition in Nostr login causing signer overwrite
2026-01-26 16:20:38 -05:00
google-labs-jules[bot]andPR0M3TH3AN 7cb603b652 fix(nostr): prevent nip-07 fallback from overwriting concurrent login
- Added a check in `ensureActiveSignerForPubkey` to verify if a valid signer (e.g. NIP-46) was registered during the extension wait period.
- Modified `nip07Permissions.js` to respect global timeout overrides for structured permission requests, fixing flaky tests.
- Added regression test `tests/nostr-signer-race.test.mjs` to simulate the race condition.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-26 21:19:47 +00:00
thePR0M3TH3AN 0c479319e6 Merge pull request #1758 from PR0M3TH3AN/fix-nip07-race-condition-15487328851099190056
Fix NIP-07 Race Condition
2026-01-26 16:03:34 -05:00
google-labs-jules[bot]andPR0M3TH3AN 1bb4d1ec85 fix(nostr): await nip-07 extension injection to resolve race conditions
This commit fixes a critical race condition where `window.nostr` might not be injected
before the app attempts to use it, causing failures in decryption (subscriptions, hashtags, DMs)
and login flows.

Changes:
- Updated `ensureExtensionPermissions` in `js/nostr/client.js` to verify `window.nostr` existence
  even when permissions are cached. If missing, it now awaits `waitForNip07Extension` instead of
  returning a false success.
- Updated `ensureActiveSignerForPubkey` in `js/nostr/client.js` to wait for the extension
  if permissions are cached but `window.nostr` is missing, ensuring a valid signer is created.

Verification:
- Confirmed `waitForNip07Extension` is imported in `js/nostr/client.js`.
- Verified `HashtagPreferencesService` already implements multi-scheme decryption and optimistic updates.
- Verified `SubscriptionsManager` implements multi-scheme decryption.
- The race condition fix ensures the signer is correctly initialized with capabilities, enabling the decryption logic to work.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-26 20:58:02 +00:00
google-labs-jules[bot]andPR0M3TH3AN a57947da0c fix(nostr): await nip-07 extension injection to resolve race conditions
This commit fixes a critical race condition where `window.nostr` might not be injected
before the app attempts to use it, causing failures in decryption (subscriptions, hashtags, DMs)
and login flows.

Changes:
- Updated `ensureExtensionPermissions` in `js/nostr/client.js` to verify `window.nostr` existence
  even when permissions are cached. If missing, it now awaits `waitForNip07Extension` instead of
  returning a false success.
- Updated `ensureActiveSignerForPubkey` in `js/nostr/client.js` to wait for the extension
  if permissions are cached but `window.nostr` is missing, ensuring a valid signer is created.

This ensures that the "Performance Analysis" optimization (skipping `enable()` calls based on cache)
does not break functionality when the extension injection is delayed.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-26 20:57:17 +00:00
thePR0M3TH3AN 91e0be0ad4 Merge pull request #1757 from PR0M3TH3AN/fix/nip07-reliability-hashtag-sync-9057175927008985329
Fix NIP-07 reliability and Hashtag sync race conditions
2026-01-26 15:41:21 -05:00
google-labs-jules[bot]andPR0M3TH3AN 5c1d1d340b fix(nostr): harden nip-07 adapter and fix hashtag sync issues
- Wrapped NIP-07 adapter extension calls in `retryNip07Call` to handle transient failures and timeouts robustly.
- Updated `HashtagPreferencesService` to autosave changes to relays immediately on modification.
- Added race condition protection in `HashtagPreferencesService.load` to prevent overwriting optimistic local updates with stale relay data.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-26 20:40:28 +00:00
thePR0M3TH3AN f55dcb5b4a Merge pull request #1756 from PR0M3TH3AN/ai/dead-code-20240523-12335260935676065759
Remove dead code: js/storage/s3-settings.js
2026-01-26 15:34:55 -05:00
google-labs-jules[bot]andPR0M3TH3AN 596bfd074a chore(ai): remove dead code (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-26 20:29:38 +00:00
thePR0M3TH3AN de463a86f4 Merge pull request #1755 from PR0M3TH3AN/fix-nip07-login-and-list-sync-2738736650874322508
Fix NIP-07 Login Slowness and Prevent List Data Loss on Network Failure
2026-01-26 15:16:40 -05:00
google-labs-jules[bot]andPR0M3TH3AN 9d820c27e9 fix(nostr): prevent list data loss on fetch failure and optimize login timeout
- Update `fetchListIncrementally` in `js/nostr/client.js` to throw an error if all relays fail, preventing empty returns from being interpreted as data loss.
- Update `HashtagPreferencesService`, `UserBlockListManager`, and `SubscriptionsManager` to handle fetch errors gracefully without wiping local state.
- Update `js/nostr/nip07Permissions.js` to use a short timeout (3s) for experimental permission requests, fixing "clunky" login issues while preserving user interaction time for standard login.
- Remove `try/catch` in `adminListStore.js` fetch logic to allow error propagation to the fallback cache logic.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-26 20:16:08 +00:00
thePR0M3TH3AN fd6301ba7c Merge pull request #1753 from PR0M3TH3AN/fix-unreachable-relay-timeout-17713574471335284394
Fix slow loading by filtering unreachable relays
2026-01-26 14:55:57 -05:00
google-labs-jules[bot]andPR0M3TH3AN c81f71b6d2 fix(client): track and filter unreachable relays to prevent timeouts
Introduces `unreachableRelays` tracking in `NostrClient` to identify relays that fail connection during initialization.
Updates fetch operations (`fetchListIncrementally`, `subscribeVideos`, etc.) to use `getHealthyRelays`, filtering out known bad relays to prevent `SimplePool` timeouts (7s) from blocking the application.
This resolves slow loading and app breakage when the user's persistent configuration contains dead relays.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-26 19:55:05 +00:00
thePR0M3TH3AN af209b405a Merge pull request #1752 from PR0M3TH3AN/ai/load-test-20260126-9118728376138210456
Enhance load test script for multi-part events
2026-01-26 14:45:25 -05:00