Commit Graph
39 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN c47392aba6 Refactor numeric constants to centralized module
- Introduce `js/constants.js` with semantic time constants (e.g., `ONE_MINUTE_MS`, `STANDARD_TIMEOUT_MS`) and feature-specific TTLs.
- Export `KIND_MUTE_LIST` from `js/nostrEventSchemas.js` to standardize NIP-51 mute list kind usage.
- Refactor `js/state/cache.js`, `js/nostr/cachePolicies.js`, `js/channelProfile.js`, and various services to use centralized constants instead of hardcoded magic numbers.
- Update `js/nostr/relayConstants.js` to derive values from the shared time constants.
- Replace duplicate definitions of timeouts and retry delays across the codebase.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 03:27:26 +00:00
Claude 696a30051b Fix lint failures, console.* convention violations, and CI Node version mismatch
- Add docs/capacitor-native-app-plan.md to hex-lint ignore list (code examples
  naturally reference hex colors in Capacitor config)
- Replace direct console.error/console.log calls with logger utility in
  historyView.js, profileCache.js, EventDetailsModal.js, ZapInterface.js,
  and notificationController.js
- Update CI workflow from Node 20 to Node 22 to match package.json engines

https://claude.ai/code/session_01LzErpH9FNw4hAPsjoYb1v9
2026-02-10 02:35:24 +00:00
google-labs-jules[bot]andPR0M3TH3AN d4beed100a Remove legacy moderation overrides support
Removed the legacy support for version 1 moderation overrides in `js/state/cache.js`. This includes removing the `LEGACY_MODERATION_OVERRIDE_STORAGE_KEY`, the migration logic in `loadModerationOverridesFromStorage`, and the cleanup logic in `persistModerationOverridesToStorage`.
Updated `tests/state/cache.test.mjs` to include tests verifying that legacy overrides are ignored and not migrated.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-08 00:33:27 +00:00
google-labs-jules[bot]andPR0M3TH3AN 53d7bc7a59 Refactor loadSavedProfilesFromStorage for better maintainability
Extracted the complex parsing, validation, and migration logic for saved profiles into a new helper function `processSavedProfilesPayload`. This reduces the complexity of `loadSavedProfilesFromStorage` and improves readability.

Functionality is preserved, including handling of legacy formats, NIP-07 auth types, and active profile normalization.

Verified with targeted tests:
- tests/state/cache-saved-profiles.test.mjs
- tests/state/cache.test.mjs

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-07 23:13:11 +00:00
google-labs-jules[bot]andPR0M3TH3AN a084bb59de refactor: deduplicate HEX64_REGEX to js/utils/hex.js
Moves the repeatedly defined HEX64_REGEX constant to a shared utility
module to improve maintainability and consistency. Updates all consumers
to import from the new location.

Signed-off-by: Jules <[email protected]>

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-07 21:52:51 +00:00
google-labs-jules[bot]andPR0M3TH3AN 88cca17de0 perf: Use requestIdleCallback for ProfileCache localStorage writes
Optimizes `setProfileData` to defer blocking `JSON.stringify` and `localStorage.setItem` calls to idle periods, significantly reducing main thread blocking time during profile updates (e.g., watch history).

- Adds `runIdle` helper with `requestIdleCallback` (fallback to `setTimeout`).
- Updates `setProfileData` to use `runIdle`.
- Updates `tests/profile-cache.test.mjs` to handle async persistence.
- Adds `benchmarks/profile_cache_storage_bench.js` to measure blocking time (370x improvement observed).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 22:59:50 +00:00
google-labs-jules[bot]andPR0M3TH3AN 0073bf223b Optimize clearMemoryCache to O(1) using nested map structure
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 20:28:49 +00:00
google-labs-jules[bot]andPR0M3TH3AN 1296e4a06a Document and verify ProfileCache O(1) clearing optimization
- Add comments to ProfileCache constructor and clearMemoryCache explaining the nested map structure.
- Add benchmarks/profile_cache_bench.js to prove performance against a linear scan baseline.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 20:13:44 +00:00
google-labs-jules[bot]andPR0M3TH3AN 307a7e4553 Refactor ProfileCache to use nested Map for O(1) clearMemoryCache
- Changed memoryCache from flat Map<string, any> to Map<string, Map<string, any>>
- Updated all accessor methods to handle nested structure
- Reduced clearMemoryCache complexity from O(N) to O(1)
- Verified with benchmark: ~3600x speedup for 20k items

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 19:33:58 +00:00
thePR0M3TH3AN f0f36e7c7b Merge cached profile and DM data safely 2026-01-29 19:01:11 -05:00
thePR0M3TH3AN 1642b787ec Reset caches on logout 2026-01-29 15:54:44 -05:00
google-labs-jules[bot] 4a0b81ad98 chore(ai): remove dead code (unused exports & deps) 2026-01-24 20:28:53 +00:00
thePR0M3TH3AN 3c75ac8c3f Add DM read receipts and typing indicators 2026-01-19 13:29:40 -05:00
google-labs-jules[bot] e11f44f2f2 test(ai): add unit tests for profileCache and appState (agent) 2026-01-18 11:15:34 +00:00
google-labs-jules[bot] a2de2b550d Fix hashtag preferences loading and profile persistence issues
- Migrated Kind 0 profile metadata storage to unified `profileCache.js` with partitioning and persistence.
- Added `defaultDTag` for hashtag preferences in `cachePolicies.js` to ensure consistent key resolution.
- Updated `hashtagPreferencesService.js` to use `profileCache` and implemented legacy data migration.
- Added `handleEvent` to `NostrClient` to centrally ingest Kind 0 events into the cache.
- Updated `authService.js` and `cache.js` to delegate profile operations to the unified cache system.
- Added `PROFILE_METADATA` schema to `nostrEventSchemas.js`.
2026-01-18 02:09:04 +00:00
google-labs-jules[bot] a1b1d85c9d feat(cache): integrate watch history with centralized registry
- Update `cachePolicies.js` to include `defaultDTag` for watch history.
- Update `profileCache.js` to resolve policies dynamically via `SECTION_TO_NOTE_TYPE`.
- Implement `resolveAddressKey` in `profileCache.js` for canonical key generation.
- Implement TTL expiration logic in `profileCache.js`.
- Update `watchHistory.js` to use `NOTE_TYPES.WATCH_HISTORY` for storage operations.
2026-01-17 23:04:08 +00:00
google-labs-jules[bot] 3deb8d08f0 Implement profile-scoped caching and signer invalidation logic
- Updated `profileCache.js` to support clearing runtime memory on signer change.
- Updated `NostrClient` to trigger `clearSignerRuntime` on `setActiveSigner`.
- Updated list services (`subscriptions`, `userBlocks`, `hashtagPreferences`, `watchHistory`) to listen for `runtimeCleared` and reload data.
- Updated `NostrClient` sync metadata methods to default to the active profile pubkey.
- Added `partition-updated` event emission to `profileCache`.
2026-01-17 21:43:35 +00:00
google-labs-jules[bot] 926e6ebf39 Refactor user-specific lists to use centralized profileCache 2026-01-17 20:47:27 +00:00
thePR0M3TH3AN 5c3230074e Add moderation override tracking by author and content 2026-01-16 13:50:32 -05:00
thePR0M3TH3AN 3a3339a57a Add per-category trusted mute thresholds 2026-01-16 10:49:32 -05:00
thePR0M3TH3AN c575f48a81 Align moderation defaults with instance config 2025-10-24 21:36:10 -04:00
thePR0M3TH3AN 15b94cfff3 Adjust moderation defaults and store per-profile settings 2025-10-21 19:26:25 -04:00
thePR0M3TH3AN 094559b618 Add per-profile settings store and mask wallet inputs 2025-10-21 17:46:41 -04:00
thePR0M3TH3AN 6d84d6be4e feat: show provider metadata in saved profiles 2025-10-21 14:44:14 -04:00
thePR0M3TH3AN ea45488ee4 Handle custom auth providers in saved profiles 2025-10-21 13:56:38 -04:00
thePR0M3TH3AN 49a0ccf2b7 Add trusted hide thresholds to moderation settings 2025-10-20 19:21:13 -04:00
thePR0M3TH3AN d977406386 Add configurable moderation thresholds in profile settings 2025-10-20 12:45:39 -04:00
thePR0M3TH3AN 9827e330e9 Respect explicit logout when hydrating saved profiles 2025-10-19 18:52:56 -04:00
thePR0M3TH3AN 0ec7c5e76c Add moderation overrides to video cards 2025-10-17 16:24:42 -04:00
thePR0M3TH3AN d0bca0a4bc Merge pull request #614 from PR0M3TH3AN/codex/change-cdn-health-check-display
Align CDN health badge with torrent badge icon
2025-10-17 10:06:04 -04:00
thePR0M3TH3AN c40187f09f Align CDN health badge checking icon with torrent badge 2025-10-17 10:05:18 -04:00
thePR0M3TH3AN c6500d6b7a Improve channel banner sanitization 2025-10-17 10:03:50 -04:00
thePR0M3TH3AN 0a2a2c4e78 Fix syntax errors blocking app bootstrap 2025-10-15 15:08:55 -04:00
thePR0M3TH3AN 7ae07b1369 refactor: migrate console usage to shared loggers 2025-10-15 14:37:25 -04:00
thePR0M3TH3AN d705cf176b Revert "Refactor logging to centralized logger" 2025-10-15 11:14:10 -04:00
thePR0M3TH3AN 37ba57aa37 Refactor logging to centralized logger 2025-10-15 11:11:14 -04:00
thePR0M3TH3AN ad0713b4cb Fix video modal stacking and playback readiness 2025-10-07 21:51:12 -04:00
thePR0M3TH3AN 61815ba289 Add nostr service layer for video operations 2025-10-03 13:41:44 -04:00
thePR0M3TH3AN 2e26242153 Fix duplicate url health reader in cache module 2025-10-02 22:03:12 -04:00