Commit Graph
4608 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN dd1fc79b83 chore(ai): remove dead code (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 15:45:21 +00:00
google-labs-jules[bot]andPR0M3TH3AN 28d52aa245 chore(ai): remove dead code (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 15:34:19 +00: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
thePR0M3TH3AN 8c331f8c14 Merge pull request #2002 from PR0M3TH3AN/revert-2001-fix-webseed-regression-9421879790599854924
Revert "Fix ignored webseeds in magnet links"
2026-01-30 17:04:31 -05:00
thePR0M3TH3AN 00899694b5 Revert "Fix ignored webseeds in magnet links" 2026-01-30 17:04:15 -05:00
thePR0M3TH3AN bdf1b140bd Merge pull request #2001 from PR0M3TH3AN/fix-webseed-regression-9421879790599854924
Fix ignored webseeds in magnet links
2026-01-30 17:01:43 -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 5b3db62513 Merge pull request #2000 from PR0M3TH3AN/revert-1996-ai/dead-code-cleanup-34771678735083742
Revert "Dead Code Cleanup"
2026-01-30 16:51:27 -05:00
thePR0M3TH3AN ceccd34681 Revert "Dead Code Cleanup" 2026-01-30 16:51:01 -05:00
thePR0M3TH3AN 5f42eccc32 Merge pull request #1999 from PR0M3TH3AN/codex/add-test-stubs-for-permission-scenarios
Add tests for permission deferral during NIP-07 login and list loads
2026-01-30 16:48:15 -05:00
thePR0M3TH3AN 80b3a2a8a5 Add permission deferral coverage for login flows 2026-01-30 16:48:03 -05:00
thePR0M3TH3AN 3db1bcf5fc Merge pull request #1998 from PR0M3TH3AN/ai/smoke-tests-20260130-7030837945485494375
chore(ai): add smoke test script (agent)
2026-01-30 16:29:49 -05:00
google-labs-jules[bot]andPR0M3TH3AN 3f9dd916a8 chore(ai): add smoke test script (agent)
- Adds `scripts/agent/smoke-test.mjs` for end-to-end regression testing.
- Verifies key flows: login, relay connect, publish video, publish DM, and DM decryption.
- Uses local relay (port 8899) and local HTTP server (port 8000).
- Generates JSON summary and logs in `artifacts/`.
- Includes Playwright frontend verification.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 21:29:19 +00:00
thePR0M3TH3AN 16e79d8179 Merge pull request #1997 from PR0M3TH3AN/codex/refactor-loginwithextension-permissions-handling
Defer NIP-07 permission prompts and surface status
2026-01-30 16:28:14 -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
thePR0M3TH3AN deec2cd573 Merge pull request #1994 from PR0M3TH3AN/codex/handle-auth-login-failures-and-permissions
Add permission CTA and retry flow for subscriptions & hashtag preferences
2026-01-30 15:40:12 -05:00
thePR0M3TH3AN acf73bc5a3 Add permission CTA for subscriptions and hashtags 2026-01-30 15:39:52 -05:00
thePR0M3TH3AN b9fb34b9cd Merge pull request #1993 from PR0M3TH3AN/fix/slow-login-and-list-loading-2798723397945382136
Fix slow login, list loading timeouts, and premature relay warnings
2026-01-30 15:32:54 -05:00
google-labs-jules[bot]andPR0M3TH3AN 6347ab0db1 fix(auth): optimize login speed and list decryption
- Reduced decryption timeout for user lists from 90s to 15s to fail faster.
- Optimized NIP-07 decryption calls to avoid retries and long timeouts during critical loading paths.
- Fixed a bug where `loginWithExtension` triggered `getPublicKey` twice, doubling the user interaction time.
- Added a 10s grace period for relay health warnings to prevent false positives on startup.
- Verified `deferBlocks` logic in `authService` prevents blocking the login UI on slow list decryption.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 20:31:24 +00:00
thePR0M3TH3AN 13f8b9f6aa Merge pull request #1992 from PR0M3TH3AN/ai/load-test-20260130-10083516329292925442
chore(ai): add load test report for 2026-01-30
2026-01-30 15:14:47 -05:00
thePR0M3TH3AN 6402187e25 Merge pull request #1991 from PR0M3TH3AN/fix-list-loading-and-nip07-slow-8603447107550191074
Fix list loading and optimize NIP-07 login
2026-01-30 14:54:34 -05:00
google-labs-jules[bot]andPR0M3TH3AN 6bf3e95a4f Fix list loading reliability and optimize NIP-07 login performance
- Fixes issue where user lists (subscriptions, blocks) fail to load if local cache is stale but metadata store is fresh.
- Updates `js/userBlocks.js` and `js/subscriptions.js` to persist `createdAt` timestamp and use it for incremental fetch `since` parameter.
- Optimizes `js/nostr/client.js` `ensureActiveSignerForPubkey` to reduce redundant `getPublicKey` calls to NIP-07 extension by 50%.
- Adds `preloadedPubkey` support to `createNip07Adapter`.
- Fixes `tests/subscriptions-manager.test.mjs` environment setup to allow CI to pass.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 19:53:04 +00:00
google-labs-jules[bot]andPR0M3TH3AN 0890775b86 chore(ai): add load test report for 2026-01-30
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 19:49:12 +00:00
google-labs-jules[bot]andPR0M3TH3AN 5bdca14364 Fix list loading reliability and optimize NIP-07 login performance
- Fixes issue where user lists (subscriptions, blocks) fail to load if local cache is stale but metadata store is fresh.
- Updates `js/userBlocks.js` and `js/subscriptions.js` to persist `createdAt` timestamp and use it for incremental fetch `since` parameter.
- Optimizes `js/nostr/client.js` `ensureActiveSignerForPubkey` to reduce redundant `getPublicKey` calls to NIP-07 extension by 50%.
- Adds `preloadedPubkey` support to `createNip07Adapter`.
- Adds reproduction test for NIP-07 concurrency issue.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 19:35:05 +00:00
thePR0M3TH3AN 792473f56f Merge pull request #1989 from PR0M3TH3AN/fix/nip07-adapter-race-condition-531357967915833285
Fix NIP-07 adapter race condition for encrypted lists
2026-01-30 14:10:40 -05:00
google-labs-jules[bot]andPR0M3TH3AN 14dfedc98d Fix NIP-07 adapter race condition and CI test crashes
- Modified `js/nostr/adapters/nip07Adapter.js` to use dynamic getters for capabilities.
- Updated `js/nostr/client.js` to respect getter descriptors on signers.
- Fixed `tests/nostr-login-permissions.test.mjs` and `tests/nostr/adapters.test.mjs` to safely handle read-only global properties in CI.
- Added hardened regression test `tests/nostr/nip07Adapter-race-condition.test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 19:04:55 +00:00
thePR0M3TH3AN e1a8cb41d2 Merge pull request #1990 from PR0M3TH3AN/ai/debug-frontend-20250212-838542710107527339
fix(ai): frontend console error — strip xs on localhost (agent)
2026-01-30 13:58:37 -05:00
google-labs-jules[bot]andPR0M3TH3AN 53a14a0dfe fix(ai): cleanup logging and use effective magnet in webtorrent.js
This commit refactors `js/webtorrent.js` to ensure the `stripXsParameter` helper is correctly used and its result (`effectiveMagnetURI`) is passed to `client.add()`.

- Refactored logic to use `effectiveMagnetURI` variable.
- Cleaned up conditional logging.
- Ensured consistent usage in `streamVideo`.

Tests run:
- `npm run lint`
- `npm run test:unit:shard1`
- `python3 scripts/agent/debug_frontend.py` (verified error is gone)

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 18:57:43 +00:00
google-labs-jules[bot]andPR0M3TH3AN 4f40025b9d fix(ai): frontend console error — strip xs on localhost (agent)
Diagnosed a CORS error on local development environment caused by WebTorrent fetching `.torrent` files from R2 buckets (via `xs` parameter) that do not allow localhost origin.

Modified `js/webtorrent.js` to strip the `xs` parameter from magnet links when running on `localhost` or `127.0.0.1`. This prevents the browser from attempting the blocked fetch request, resolving the console error while maintaining functionality (falling back to DHT/peers).

Verified using `scripts/agent/debug_frontend.py` which captures frontend console logs via Playwright.

Tests run:
- `npm run lint`
- `npm run test:unit:shard1`
- `python3 scripts/agent/debug_frontend.py` (verified error is gone)

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 18:53:25 +00:00
google-labs-jules[bot]andPR0M3TH3AN d38585f376 Fix NIP-07 adapter race condition with lazy encryption capability injection
- Modified `js/nostr/adapters/nip07Adapter.js` to use dynamic getters for `capabilities` (nip04/nip44) and unconditionally expose encryption methods.
- Updated `js/nostr/client.js` to use `Object.getOwnPropertyDescriptor` when handling `signer.capabilities`.
- Added `tests/nostr/nip07Adapter-race-condition.test.mjs` to verify the fix.
- Fixed test environment issues in `tests/nostr/adapters.test.mjs` and `tests/nostr-login-permissions.test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 18:47:08 +00:00
google-labs-jules[bot]andPR0M3TH3AN 51924d1619 fix(nostr): handle lazy NIP-44 injection in NIP-07 adapter
Updates `js/nostr/adapters/nip07Adapter.js` to unconditionally expose encryption methods (`nip04Encrypt`, `nip44Decrypt`, etc.) and use dynamic property getters for capabilities. This fixes a race condition where the adapter would initialize without NIP-44 support if the browser extension injected the `nip44` API slightly after `window.nostr` became available, preventing encrypted user lists (subscriptions, blocks, hashtags) from loading.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 18:19:44 +00:00
thePR0M3TH3AN 6a55bd9a60 Merge pull request #1988 from PR0M3TH3AN/fix-auth-race-condition-7254158584929414727
Fix race condition in user list loading during login
2026-01-30 12:43:54 -05:00
google-labs-jules[bot]andPR0M3TH3AN 8373529c76 fix(app): sequence user list loading after profile relays are initialized
Prior to this change, user-specific lists (block lists, subscriptions, hashtag preferences, DMs, NWC settings) were fetched concurrently with the profile/relay initialization in `handleAuthLogin`. This caused a race condition where the application would attempt to fetch sensitive user data using default relays instead of the user's preferred relays, often resulting in empty or stale data.

This patch refactors `handleAuthLogin` in `js/app.js` to chain the loading of these lists to the completion of `profileStatePromise` (which ensures relays are loaded via `postLoginPromise`). This guarantees that the correct relays are used for fetching user-specific data.

Also defines `dmStatePromise`, `nwcPromise` and `hashtagPreferencesPromise` which were previously referenced but seemingly undefined in the scope, ensuring proper promise tracking.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 17:41:47 +00:00
google-labs-jules[bot]andPR0M3TH3AN 962f943b53 fix(app): sequence user list loading after profile relays are initialized
Prior to this change, user-specific lists (block lists, subscriptions, hashtag preferences, DMs, NWC settings) were fetched concurrently with the profile/relay initialization in `handleAuthLogin`. This caused a race condition where the application would attempt to fetch sensitive user data using default relays instead of the user's preferred relays, often resulting in empty or stale data.

This patch refactors `handleAuthLogin` in `js/app.js` to chain the loading of these lists to the completion of `profileStatePromise` (which ensures relays are loaded via `postLoginPromise`). This guarantees that the correct relays are used for fetching user-specific data.

Also defines `dmStatePromise`, `nwcPromise` and `hashtagPreferencesPromise` which were previously referenced but seemingly undefined in the scope, ensuring proper promise tracking.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 17:35:39 +00:00
google-labs-jules[bot]andPR0M3TH3AN 9481de9e0a fix(app): sequence user list loading after profile relays are initialized
Prior to this change, user-specific lists (block lists, subscriptions, hashtag preferences, DMs, NWC settings) were fetched concurrently with the profile/relay initialization in `handleAuthLogin`. This caused a race condition where the application would attempt to fetch sensitive user data using default relays instead of the user's preferred relays, often resulting in empty or stale data.

This patch refactors `handleAuthLogin` in `js/app.js` to chain the loading of these lists to the completion of `profileStatePromise` (which ensures relays are loaded via `postLoginPromise`). This guarantees that the correct relays are used for fetching user-specific data.

Also defines `dmStatePromise`, `nwcPromise` and `hashtagPreferencesPromise` which were previously referenced but seemingly undefined in the scope, ensuring proper promise tracking.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 17:25:07 +00:00
thePR0M3TH3AN b8fad92b25 Merge pull request #1986 from PR0M3TH3AN/fix-nip07-decryption-13328665886531040373
fix(nostr): correctly resolve signer capabilities when methods are present
2026-01-30 11:43:25 -05:00
thePR0M3TH3AN cd6e8e9f27 Merge pull request #1987 from PR0M3TH3AN/load-relays-before-fetching-profile-7456935442893055659
Load user relays before fetching profile and feed
2026-01-30 11:41:33 -05:00
google-labs-jules[bot]andPR0M3TH3AN cfb395ff1a fix(tests): update expected relay health state in unit test
This update aligns `tests/services/relay-health-service.test.mjs` with the actual state object structure used in `RelayHealthService`, which now includes `consecutiveFailures` and `lastUserLogAt` properties. This fixes a CI failure in the `agent-review` job.

The previous fix for `tests/app-batch-fetch-profiles.test.mjs` (duplicate variable) is also included in this branch history.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 16:36:27 +00:00
google-labs-jules[bot]andPR0M3TH3AN fdc070479b Optimize post-login sequence to load relays before other data
Prioritizes fetching the user's relay list (NIP-65) immediately after login, ensuring that subsequent data fetches (profile, contact list, DMs, feed) utilize the user's preferred relays instead of default ones. This prevents "slow" or incomplete data loading issues caused by relying on defaults.

- Refactored `authService.applyPostLoginState` to sequence relay loading before profile/block loading.
- Refactored `app.handleAuthLogin` to await relay loading before initiating dependent fetches (Hashtags, Moderation, DMs, NWC, Lists, Feed).
- Updated unit tests in `tests/auth-service.test.mjs` to verify sequential execution and correct return values.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 16:34:12 +00:00
google-labs-jules[bot]andPR0M3TH3AN 991d166254 fix(tests): remove duplicate variable declaration in profile batch fetcher test
This fixes a syntax error in `tests/app-batch-fetch-profiles.test.mjs` where `originalReadRelays` was declared twice, causing the CI `agent-review` job (and subsequent deploy checks) to fail.

The underlying NIP-07 decryption fix (correctly resolving signer capabilities) remains in place from the previous commit.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 16:26:31 +00:00
google-labs-jules[bot]andPR0M3TH3AN 730618efa8 fix(nostr): correctly resolve signer capabilities when methods are present
This fixes a critical issue where valid NIP-07 signers were treated as incapable of NIP-44/NIP-04 operations if their initial `capabilities` flag was false, even if the necessary methods (e.g., `nip44Decrypt`) were subsequently added or already present.

This addresses errors like "Gift wrap events require a NIP-44 decryptor" for users with valid extensions.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 16:20:13 +00:00
thePR0M3TH3AN 8a3e337e97 Merge pull request #1985 from PR0M3TH3AN/ai/fuzz-suite-20260130-14030343412094288093
Add fuzz testing suite for Nostr schemas, DM decryptor, and Magnet utils
2026-01-30 11:14:31 -05:00
google-labs-jules[bot]andPR0M3TH3AN dc2dc70b69 test(fuzz): add fuzzing harnesses for schemas, dm, and magnet utils
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 16:14:02 +00:00
thePR0M3TH3AN 35698340a8 Merge pull request #1984 from PR0M3TH3AN/codex/add-relay-health-panel-to-ui
Add relay health summary and persistent failure logging
2026-01-30 11:08:15 -05:00
thePR0M3TH3AN 09c0ac8127 Add relay health summary banner 2026-01-30 11:08:02 -05:00
thePR0M3TH3AN 93f78e60ee Merge pull request #1968 from PR0M3TH3AN/ai/reproducers-popover-video-20260129-656412173162674175
chore(ai): add minimal reproducers for known bugs
2026-01-30 11:07:07 -05:00