Commit Graph
19 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN 1954739624 Fix NIP-07 decryption fallback and storage unlock issues
- Updated `StorageService` to check `signer.capabilities` before calling encryption methods, ensuring graceful fallback from NIP-44 to NIP-04.
- Updated `UserBlockList` to check `signer.capabilities` before registering decryptors, preventing "Decryption timed out" errors caused by queueing unsupported method calls.
- Fixed flakiness in `tests/user-blocks.test.mjs` by adding delays to allow background promises to settle between tests.
- Verified changes with reproduction test case and existing test suite.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-02 19:59:24 +00:00
google-labs-jules[bot]andPR0M3TH3AN de5e453b34 Refactor user blocking to prioritize standard NIP-51 Mute Lists
- Updates `js/userBlocks.js` to write block entries to a standard Kind 10000 Mute List event.
- Implements a hybrid storage model: unencrypted public mutes are stored in `p` tags, while private blocks are stored in the encrypted event content.
- Maintains read compatibility with legacy `d=user-blocks` lists (both Kind 10000 and Kind 30002) by merging and prioritizing the newest event timestamp.
- Updates local caching to persist both public mutes and private blocks, preventing data loss or "zombie" entries on reload.
- Updates `js/subscriptions.js` to correctly detect NIP-44 capabilities on `Nip07Adapter` signers, fixing a regression where NIP-04 fallback was skipped.
- Updates `js/nostrEventSchemas.js` to mark `USER_BLOCK_LIST` as legacy and define `MUTE_LIST`.
- Updates unit tests to verify the new multi-kind fetching and merged publishing logic.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 22:10:42 +00:00
google-labs-jules[bot]andPR0M3TH3AN 8383a4f18b Migrate user blocks to standard NIP-51 Mute List
- Updates `js/userBlocks.js` to treat Kind 10000 (standard Mute List) as the primary write target.
- Public mutes are stored in `p` tags, and private blocks are stored in encrypted content within the same event.
- Legacy `d=user-blocks` lists are still read for backward compatibility (preferring the newest event), but no longer written.
- Updates `js/nostrEventSchemas.js` to mark `USER_BLOCK_LIST` as legacy and standardise `MUTE_LIST`.
- Updates UI controllers (`MoreMenuController`, `ProfileModalController`) to use "Mute/Block List" terminology and delegate all mute/block actions to `userBlocks`.
- Updates `ModerationService` to delegate viewer mute operations to `userBlocks` and disable direct Kind 10000 publishing to prevent overwrites.
- Documentation updated in `docs/nostr-event-schemas.md`.
- Fixes regressions in `more-menu-controller.test.mjs`, `moderation-service.test.mjs`, `trusted-mute-lists.test.mjs`, and `user-blocks.test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 21:47:29 +00:00
thePR0M3TH3AN 80b3a2a8a5 Add permission deferral coverage for login flows 2026-01-30 16:48:03 -05:00
google-labs-jules[bot]andPR0M3TH3AN 018fd6d599 refactor: update user block fetch logic to prioritize kind 10000 with d-tag
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]>
2026-01-27 23:59:58 +00:00
google-labs-jules[bot]andPR0M3TH3AN 5b69722f72 Improve relay selection and fault tolerance for list fetching
- 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]>
2026-01-27 22:54:31 +00:00
google-labs-jules[bot] 6884d06192 chore(ai): event schema validation tool + fixes
- Added `scripts/agent/validate-events.mjs` for builder validation.
- Enhanced `js/nostrEventSchemas.js` with `validateEventStructure`.
- Fixed `safeStringify` to handle objects correctly.
- Added `NOTE_TYPES.HTTP_AUTH` and `NOTE_TYPES.REPORT` with builders.
- Refactored `js/userBlocks.js`, `js/auth/signingAdapter.js`, `js/services/moderationService.js` to use builders.
- Updated `tests/user-blocks.test.mjs` mocks and assertions.
- Updated documentation.
2026-01-24 05:36:40 +00:00
google-labs-jules[bot] 124a2330ad Update block list selection to prioritize tagged events
- Prioritize Kind 10000 events with `d=user-blocks` over plain mute lists in `loadBlocks`.
- Add `isTaggedBlockListEvent` helper for differentiation.
- Add regression test case to `tests/user-blocks.test.mjs` verifying that tagged lists override newer plain lists.
2026-01-11 21:08:01 +00:00
google-labs-jules[bot] 009eb4c6e2 Fix: Handle tag-only Kind 10000 mute lists in UserBlockListManager
This commit modifies `js/userBlocks.js` to correctly parse Kind 10000 events that have empty content but populated `p` tags (used by clients like Primal). Previously, these events were treated as empty block lists, causing the user's block list to be cleared.

Changes:
- Refactored `loadBlocks` to check for empty content and fallback to extracting pubkeys from tags using `extractPubkeysFromTags`.
- Updated `loadBlocks` to use a sequential promise strategy (`Promise.any` then `Promise.allSettled`) to ensure eventual consistency without race conditions or double-processing.
- Added extensive tests in `tests/user-blocks.test.mjs` covering tag-only lists, whitespace content, and concurrency scenarios.
2026-01-11 20:01:39 +00:00
thePR0M3TH3AN 3996986e63 Remove nostr shim and retarget imports 2026-01-06 15:32:21 -05:00
thePR0M3TH3AN 9e969e8120 Sanitize mute tags before publishing block list 2025-11-12 09:28:04 -05:00
thePR0M3TH3AN 2fae0a0e7c Update subscription and block lists to encrypted tag arrays 2025-10-30 15:51:21 -04:00
thePR0M3TH3AN bd40bd1997 Prefer nip44.v2 for private lists and update tests 2025-10-30 10:20:08 -04:00
thePR0M3TH3AN ca8bbcad9b Publish trusted mute lists with block updates 2025-10-25 15:22:52 -04:00
thePR0M3TH3AN 001bbaa3bf Handle direct signer decryptors for user blocks 2025-10-21 21:34:24 -04:00
thePR0M3TH3AN d7405883d2 Ensure subscription publishing targets configured write relays 2025-10-20 22:59:29 -04:00
thePR0M3TH3AN 023475843c Seed shared blocklist for first-time logins 2025-10-20 14:30:40 -04:00
thePR0M3TH3AN b0f0c86f19 Handle background block list fetch fallbacks 2025-10-20 13:59:41 -04:00
thePR0M3TH3AN b02d275bdb Parallelize block list relay fetches 2025-10-09 13:45:18 -04:00