- Added reproducer for Moderation UI visibility bug in `examples/reproducers/issue-moderation-visibility`.
- Added reproducer for Popover viewport bug in `examples/reproducers/issue-popover-viewport`.
- Added `examples/reproducers/playwright.config.ts` to support running these reproducers with a local web server serving the repo root.
- Verified that both reproducers successfully fail as expected in the current environment.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Add `source: "nsec"` to session actor mocks in `tests/watch-history.test.mjs` to fix `isSessionActor` check blocking execution.
- Implement retry loop in `testWatchHistoryFeedHydration` to mitigate race conditions.
- Relax assertion in `testWatchHistoryPartialRelayRetry` to accommodate varying retry counts.
Co-authored-by: PR0M3TH3AN <[email protected]>
Previously, `runNip07WithRetry` cached the initial promise of a NIP-07 operation. If a request timed out (e.g., due to a dropped extension popup), the retry logic would re-await the same stale promise, causing the application to hang indefinitely instead of sending a new request.
This commit modifies `runNip07WithRetry` to invoke the operation factory function on every attempt, ensuring that retries generate fresh requests to the extension.
Fixes slow/stalled list syncing (hashtags, subscriptions) for users with NIP-07 extensions.
Co-authored-by: PR0M3TH3AN <[email protected]>
Implemented a mechanism to cancel the pending NIP-46 handshake when the user clicks 'Cancel' in the login modal.
- Added `pendingHandshakeCancel` callback to `NostrClient` to reject the handshake promise.
- Updated `LoginModalController` to invoke `disconnectRemoteSigner` on cancellation.
- Prevented `onLoginError` callback from triggering when the error code is `login-cancelled`.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Added `onMessage` callback to `NostrClient.listDirectMessages` to stream decrypted messages.
- Updated `NostrService.loadDirectMessages` to use the callback and trigger `applyDirectMessage` incrementally.
- Updated `ProfileModalController` to allow rendering updates during the initial load if the reason is `load-incremental`.
- Verified changes with existing tests and code review.
Co-authored-by: PR0M3TH3AN <[email protected]>
Changes `loadBlocks` to fetch `kind: 10000` with `d=user-blocks` instead of `kind: 30002` for block lists, while keeping the generic `kind: 10000` fetch for mute lists.
Updates `applyEvents` to separate block lists (tagged or legacy 30002) from mute lists (untagged 10000) and merge them instead of prioritizing one over the other.
Updates tests to reflect the merged behavior.
Co-authored-by: PR0M3TH3AN <[email protected]>
This commit updates `HashtagPreferencesService.decryptEvent` to register and utilize decryption methods from `window.nostr` (NIP-04 and NIP-44) as a fallback mechanism. This ensures that users without an active internal signer (e.g., read-only or extension-only users) can still decrypt their preferences if they have granted permission to the extension.
- Mirrors the decryption logic from `UserBlockListManager` (`js/userBlocks.js`).
- Adds logging for fallback attempts and failures.
- Preserves existing scheme selection logic (`determineDecryptionOrder`).
- Adds new test cases to `tests/hashtag-preferences.test.mjs` verifying fallback behavior when the active signer is missing or incapable.
Co-authored-by: PR0M3TH3AN <[email protected]>
- In `js/subscriptions.js`, updated `decryptSubscriptionEvent` to register decryptors from `window.nostr` (NIP-04 and NIP-44 v2) alongside the active signer.
- Refactored permission request logic to only trigger `requestDefaultExtensionPermissions` if neither the active signer nor `window.nostr` supports the required encryption schemes.
- Implemented "fail-fast" behavior to return an error immediately if no suitable decryptor is available, avoiding unnecessary timeouts.
- Removed redundant permission checks from `updateFromRelays` as the logic is now centralized in `decryptSubscriptionEvent`.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Update `scripts/automated-pr-review.mjs` to include missing sensitive paths (`js/auth/`, `js/magnetUtils.js`, `js/nostr/adapters/nip07Adapter.js`) and improve commit messaging for automated fixes.
- Add release channel guidance checks for `unstable` branch in `automated-pr-review.mjs`.
- Create `scripts/agent/review-open-prs.mjs` to robustly batch process open PRs using the updated review script.
- Remove redundant scripts `scripts/agent/automated-pr-review.mjs` and `scripts/agent/review-pr.mjs`.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Updated `NostrClient.fetchListIncrementally` to prioritize user's NIP-65 read relays, cap concurrent requests, and temporarily mark failing relays as unreachable.
- Added `markRelayUnreachable` to `NostrClient` for temporary relay exclusion.
- Updated `SubscriptionsManager`, `HashtagPreferencesService`, and `UserBlockListManager` to use `relayManager.getReadRelayUrls()` for selecting relays, ensuring consistency with user preferences.
- Added structured logging for relay selection in `fetchListIncrementally`.
- Updated unit tests to mock `relayManager` behavior correctly.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Refactoring `scripts/check-hex.js` to use git's native search instead of `ripgrep` for better portability and dependency reduction.
- Updating `tests/ui/uploadModal-integration.test.mjs` to ensure DOM isolation between tests using `beforeEach` cleanup, resolving state pollution issues.
Co-authored-by: PR0M3TH3AN <[email protected]>
Added scripts/agent/smoke-test.mjs to verify login, relay connection, video publishing, and DM decryption flows using a headless Node.js client.
The script polyfills the necessary browser environment for NostrClient and uses local relay/server resources.
Co-authored-by: PR0M3TH3AN <[email protected]>
Explicitly find the #uploadModal element within the parsed template wrapper using querySelector instead of relying on firstElementChild. This prevents null pointer exceptions in JSDOM environments where leading whitespace in the template string creates a text node as the first child.
Co-authored-by: PR0M3TH3AN <[email protected]>
Refactored the test suite to use `beforeEach` for mocking `global.fetch` and `afterEach` for cleaning up `document.body`. This ensures that `fetch` is available for all tests and that DOM state (specifically elements with duplicate IDs) does not leak between tests, resolving `TypeError: Cannot read properties of null` failures in `UploadModal.bindEvents`.
Co-authored-by: PR0M3TH3AN <[email protected]>