- Fix flaky `tests/hashtag-preferences.test.mjs` by correcting mock implementation.
- 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 properly.
- Clean up `package.json` by removing duplicate devDependencies (`autoprefixer`, `@tailwindcss/typography`) that are already in `dependencies`.
- Ensure `tailwindcss`, `postcss`, `autoprefixer`, and `@tailwindcss/typography` are in `dependencies` for robust production builds.
Co-authored-by: PR0M3TH3AN <[email protected]>
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]>
- 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` (ReferenceError fix).
- Fix 90s timeout in `HashtagPreferencesService` by clearing the timeout timer upon successful decryption.
- Correct `package.json` dependency classification:
- Remove duplicate devDependencies (`autoprefixer`, `@tailwindcss/typography`) that are already in `dependencies`.
- Ensure build-critical tools (`tailwindcss`, etc.) are in `dependencies` to survive `npm prune --production` on Netlify.
- Install `esbuild` and `cross-env` as devDependencies.
Co-authored-by: PR0M3TH3AN <[email protected]>
- 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` (ReferenceError fix).
- Fix 90s timeout in `HashtagPreferencesService` by clearing the timeout timer upon successful decryption.
- `npm install` was run to ensure dependencies like `jsdom` are present.
Co-authored-by: PR0M3TH3AN <[email protected]>
- 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]>
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]>
- 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]>
- 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]>
- 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]>
- 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]>
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]>
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]>
- 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]>