Commit Graph
4820 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN ec77f50744 fix(nostr): prevent count timeouts from disconnecting relays
Prevents "count-timeout" errors from tripping the global circuit breaker in NostrClient. This ensures that slow auxiliary requests do not block critical subscription connections, resolving login issues in unstable network environments.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-02 20:29:25 +00:00
thePR0M3TH3AN 725db3723c Merge pull request #2074 from PR0M3TH3AN/fix-nip07-decryption-fallback-8014641787403501507
Fix NIP-07 decryption fallback robustness
2026-02-02 15:15:09 -05:00
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
thePR0M3TH3AN c47e797ee4 Merge pull request #2073 from PR0M3TH3AN/update-getting-started-docs-7696444727591402786
docs: update getting started with installation instructions
2026-02-02 14:50:45 -05:00
google-labs-jules[bot]andPR0M3TH3AN e1be63efc8 docs: update getting started with installation instructions
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-02 19:50:04 +00:00
thePR0M3TH3AN b478cbaf01 Merge pull request #2072 from PR0M3TH3AN/dm-settings-modal-8234527829829252881
Refactor DM settings to modal
2026-02-02 14:43:42 -05:00
google-labs-jules[bot]andPR0M3TH3AN 9485003ffd Refactor DM settings into a dedicated modal
- Created `DMSettingsModalController` to manage the new settings modal UI.
- Added `components/dm-settings-modal.html` with sections for Privacy and DM Relay Hints.
- Updated `AppShell.js` to delegate the settings action to `onOpenSettings` callback, bypassing the legacy popover.
- Updated `ProfileModalController.js` to wire up the new modal controller, handling state persistence for relays and privacy settings.
- This improves the UX for managing NIP-17 DM relay hints and privacy options.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-02 19:43:06 +00:00
thePR0M3TH3AN bb841a2fdc Merge pull request #2071 from PR0M3TH3AN/ai/load-test-20260202-11680189359355350206
Load Test Report 2026-02-02
2026-02-02 14:33:59 -05:00
google-labs-jules[bot]andPR0M3TH3AN 95b7c6df47 feat: add load test script and report
- Implement CPU usage tracking in load-test.mjs
- Run load test with 1000 clients for 60s
- Generate load-report.json with identified bottlenecks (crypto)

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-02 19:25:56 +00:00
thePR0M3TH3AN 6c51b3d6f2 update 2026-02-02 13:45:30 -05:00
thePR0M3TH3AN fe92281802 Merge pull request #2069 from PR0M3TH3AN/ai/docs-align-lint-instructions-1029896231955410125
docs: align CONTRIBUTING.md linting instructions with package.json
2026-02-02 12:15:00 -05:00
thePR0M3TH3AN 793a8ab8d3 Merge pull request #2070 from PR0M3TH3AN/ai/perf-subscribeVideos-batching-9436508141846921918
⚡ Batch subscribeVideos updates to optimize initial load
2026-02-02 12:14:45 -05:00
google-labs-jules[bot]andPR0M3TH3AN 1e53070717 perf: batch video updates in subscribeVideos to reduce UI thrashing
Updates `NostrClient.subscribeVideos` to buffer incoming events and invoke the `onVideo` callback once per flush cycle with an array of updates, instead of once per video. This significantly reduces redundant sorting, filtering, and persistence operations in `NostrService`.

Also optimizes `populateNip71MetadataForVideos` to run as a single batched request per flush cycle.

BREAKING CHANGE: `subscribeVideos` callback now receives `Video[]` instead of `Video`. All internal consumers have been updated.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-02 17:04:55 +00:00
google-labs-jules[bot]andPR0M3TH3AN b537e4bb66 docs: align CONTRIBUTING.md linting instructions with package.json
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-02 17:02:51 +00:00
thePR0M3TH3AN 1ef2db012e Merge pull request #2068 from PR0M3TH3AN/fix-nip07-priority-contention-7510868666497074829
Fix NIP-07 Priority Inversion
2026-02-02 09:26:43 -05:00
google-labs-jules[bot]andPR0M3TH3AN 9c38ce5105 Fix resource contention between Block List decryption and View Counter signing
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-02 14:20:28 +00:00
thePR0M3TH3AN 29427b01e0 Merge pull request #2066 from PR0M3TH3AN/ai/dm-animation-fix-16717253294700761218
Prevent repeated DM peek animation
2026-02-02 09:11:30 -05:00
thePR0M3TH3AN 3328402b1c Merge pull request #2067 from PR0M3TH3AN/ai/combine-relay-health-list-16567863514667506835
Combine relay list and health check UI
2026-02-02 09:11:02 -05:00
google-labs-jules[bot]andPR0M3TH3AN 5df489e504 Combine relay list with relay health check
- Remove separate relay health panel from profile modal.
- Merge health indicators (latency, errors) directly into the relay list items.
- Consolidate refresh logic to update both list configuration and health status.
- Move telemetry toggle to the bottom of the relay section.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-02 14:03:09 +00:00
google-labs-jules[bot]andPR0M3TH3AN ffa6b7076d fix(dm): prevent repeated peek animation on re-renders
Use module-level variables to track if the peek animation has played for ConversationList and MessageThread, ensuring it only runs once per page session to avoid annoying scrolling behavior.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-02 14:02:35 +00:00
thePR0M3TH3AN d018e21ad4 Merge pull request #2065 from PR0M3TH3AN/ai/subscription-history-feature-13920162172659924347
Add Subscription History & Backup/Restore
2026-02-01 22:37:02 -05:00
thePR0M3TH3AN 4a20f259f6 Merge pull request #2064 from PR0M3TH3AN/ai/update-user-docs-content-14408644579860445969
🌐 Align /content user docs with actual upload & contribution behavior
2026-02-01 22:35:37 -05:00
thePR0M3TH3AN cb67d6c5d5 Merge pull request #2063 from PR0M3TH3AN/ai/preload-watch-history-for-you-2322053376224863961
Preload and filter watch history in For You feed
2026-02-01 22:34:52 -05:00
google-labs-jules[bot]andPR0M3TH3AN 00ca2298e1 Fix CI lint error: Replace arbitrary tailwind value
- Replaced `h-[80vh]` with standard `h-4/5` in `components/subscription-history-modal.html` to satisfy `lint:tailwind-brackets` token rules.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-02 03:11:19 +00:00
google-labs-jules[bot]andPR0M3TH3AN a50e5c861a Add subscription history and backup/restore functionality
- Added `SUBSCRIPTION_BACKUP` note type schema
- Implemented `createBackup`, `fetchHistory`, `restoreBackup`, `rebroadcastBackup` in `SubscriptionsManager`
- Added Subscription History UI modal with list/details view
- Integrated History/Backup buttons into Profile Modal Subscriptions pane
- Fixed XSS vulnerability in history details view
- Added profile fetching for history details

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-02 03:05:13 +00:00
google-labs-jules[bot]andPR0M3TH3AN 55b588ded9 docs: update /content user guides to match upload workflow and moderation config
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-02 03:02:16 +00:00
google-labs-jules[bot]andPR0M3TH3AN 511cfa25cf fix(for-you): preload watch history and filter watched videos
Preload watch history in `refreshForYouFeed` to ensure `watchHistoryService` has the latest data.
Update `buildForYouFeedRuntime` to include a `watchHistory` suppression hook that checks against preloaded watch history items.
Register `createWatchHistorySuppressionStage` in the "for-you" feed pipeline to filter out watched videos.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-02 02:55:55 +00:00
thePR0M3TH3AN fe54eb3572 Merge pull request #2062 from PR0M3TH3AN/ai/fix-slow-blocklist-loading-159527443016783103
Fix slow loading of user mute/block lists
2026-02-01 21:49:15 -05:00
google-labs-jules[bot]andPR0M3TH3AN 24a8d1da80 optimize user block list loading performance
Prioritizes fetching standard NIP-51 (Kind 10000) mute lists with a fail-fast timeout (6s) and applies them immediately upon receipt. Legacy block lists (Kind 30002, Kind 10000 d=user-blocks) are now fetched in the background without blocking the UI initialization.

This resolves an issue where slow relays handling legacy queries could cause the entire block list loading process to hang for minutes.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-02 02:47:05 +00:00
thePR0M3TH3AN 2398d63e53 Merge pull request #2060 from PR0M3TH3AN/ai/update-user-block-list-docs-17906263339608828715
Update User Block List documentation in nostr-event-schemas.md
2026-02-01 21:12:57 -05:00
google-labs-jules[bot]andPR0M3TH3AN 655cdb4a7e docs: update User Block List schema description
- Updated "User block list" row in docs/nostr-event-schemas.md to describe encrypted JSON arrays of NIP-51 tag tuples.
- Added note about migration to standard Mute List (kind 10000).
- Added NIP-51 cross-reference.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 22:21:57 +00:00
thePR0M3TH3AN 3da8707929 Merge pull request #2059 from PR0M3TH3AN/ai/nip51-mute-list-migration-1978282445834244087
Migrate user blocks to NIP-51 Mute List
2026-02-01 17:14:00 -05: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 4147211a3f Merge pull request #2058 from PR0M3TH3AN/codex/refactor-subscriptions-for-nip-44-preference
Prefer NIP-44 encryption hints for subscription lists
2026-02-01 15:55:51 -05:00
thePR0M3TH3AN 452d5b1e88 Update subscription encryption tagging and decryption 2026-02-01 15:55:39 -05:00
thePR0M3TH3AN 38209dc6e7 Merge pull request #2057 from PR0M3TH3AN/ai/fix-webtorrent-playback-stall-8715021047913895590
Fix WebTorrent playback stall (gray screen)
2026-02-01 15:31:30 -05:00
google-labs-jules[bot]andPR0M3TH3AN 687b419182 fix: robustify WebTorrent playback startup to prevent gray screen
Improves the playback startup sequence in `js/webtorrent.js` by explicitly listening for `loadeddata` in addition to `canplay` and checking `readyState` immediately after streaming starts. This ensures autoplay is triggered reliably even if the browser has already buffered enough data or if the `canplay` event logic is bypassed.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 20:30:59 +00:00
thePR0M3TH3AN 8c436aa613 Merge pull request #2056 from PR0M3TH3AN/ai/fix-webtorrent-timeout-8639299030236718023
Disable playback timeout for WebTorrent-only sources
2026-02-01 15:11:06 -05:00
google-labs-jules[bot]andPR0M3TH3AN 32395e16a0 fix(playback): disable timeout for webtorrent-only sources
When a video has no fallback URL (CDN), the playback service now waits indefinitely for peers instead of timing out after 3 seconds. This prevents premature failures for WebTorrent-only content.

Ref: `js/services/playbackService.js`

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 20:08:42 +00:00
thePR0M3TH3AN 4142478400 Merge pull request #2055 from PR0M3TH3AN/ai/docs-webtorrent-architecture-16284283299997115338
docs: Add WebTorrent architecture docs and harden regression tests
2026-02-01 14:50:52 -05:00
google-labs-jules[bot]andPR0M3TH3AN ee46b36a25 docs: add detailed webtorrent architecture and regression prevention comments
- Create `docs/webtorrent-architecture.md` detailing the "Webseeds are Peers" strategy.
- Update `docs/video-availability-checks.md` with cross-reference.
- Add "CRITICAL" warning comments to `js/webtorrent.js` and `js/gridHealth.js` to prevent regressions.
- Enhance `tests/webtorrent-regression.test.mjs` to explicitly verify `urlList` passing in mocks.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 19:35:02 +00:00
thePR0M3TH3AN bcc1a6ca0f Merge pull request #2054 from PR0M3TH3AN/ai/load-test-20260201-13346984685829774924
feat: add load-test script for relay interactions
2026-02-01 14:29:30 -05:00
thePR0M3TH3AN 0a0e82839b Merge branch 'unstable' into ai/load-test-20260201-13346984685829774924 2026-02-01 14:29:19 -05:00
google-labs-jules[bot]andPR0M3TH3AN eb4bc255d5 feat: add load-test script and fix lint exclusions
This adds `scripts/agent/load-test.mjs`, a stress testing tool that:
- Spawns a local relay server in a separate process.
- Simulates N concurrent WebSocket clients.
- Publishes a configurable mix of large (Video Post) and small (View) events.
- Measures and reports on latency, throughput, memory usage, and cryptographic signing time.
- Identifies potential bottlenecks (error rate > 5%, latency > 500ms, sign time > 5ms).

Includes a sample run report in `artifacts/`.

Also updates linting scripts (`scripts/check-hex.js`, `scripts/check-design-tokens.mjs`, `scripts/check-inline-styles.mjs`, `scripts/check-tailwind-colors.mjs`) to correctly ignore working directories (`bitvid-working-webtorrent`, `scripts/agent`), preventing CI failures.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 19:16:13 +00:00
google-labs-jules[bot]andPR0M3TH3AN 7f848aa810 feat: add load-test script for relay interactions
This introduces `scripts/agent/load-test.mjs`, a stress testing tool that:
- Spawns a local relay server in a separate process.
- Simulates N concurrent WebSocket clients.
- Publishes a configurable mix of large (Video Post) and small (View) events.
- Measures and reports on latency, throughput, memory usage, and cryptographic signing time.
- Identifies potential bottlenecks (error rate > 5%, latency > 500ms, sign time > 5ms).

Includes a sample run report in `artifacts/`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 19:09:29 +00:00
thePR0M3TH3AN 7d749f9494 Merge pull request #2053 from PR0M3TH3AN/ai/fix-webtorrent-webseeds-7078139309530458184
fix(webtorrent): correct webseed handling and health checks
2026-02-01 14:09:24 -05:00
google-labs-jules[bot]andPR0M3TH3AN 13ac53f4b9 fix(webtorrent): correct webseed handling, health checks, and linting exclusions
Reverts `js/webtorrent.js` and `js/gridHealth.js` to a simplified implementation that correctly treats webseeds as peers. This ensures that videos with only webseeds (and 0 P2P peers) are considered healthy and playable, resolving an issue where such videos were marked as unhealthy or failed to stream.

- Updates `js/webtorrent.js` to use `client.add(url, { urlList: [...] })` for better webseed integration.
- Updates `js/gridHealth.js` to rely on `peers > 0` for health, removing complex `webseedOnly` logic.
- Updates `tests/webtorrent-regression.test.mjs` to verify that webseeds are counted as peers and result in a healthy state with reason "peer".
- Excludes `bitvid-working-webtorrent/**` from all linting scripts (`scripts/check-hex.js`, `scripts/check-design-tokens.mjs`, `scripts/check-inline-styles.mjs`, `scripts/check-tailwind-colors.mjs`, `stylelint.config.cjs`) to prevent CI failures from reference code.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 18:50:32 +00:00
google-labs-jules[bot]andPR0M3TH3AN 3859d8f60f fix(webtorrent): correct webseed handling and health checks
Reverts `js/webtorrent.js` and `js/gridHealth.js` to a simplified implementation that correctly treats webseeds as peers. This ensures that videos with only webseeds (and 0 P2P peers) are considered healthy and playable, resolving an issue where such videos were marked as unhealthy or failed to stream.

- Updates `js/webtorrent.js` to use `client.add(url, { urlList: [...] })` for better webseed integration.
- Updates `js/gridHealth.js` to rely on `peers > 0` for health, removing complex `webseedOnly` logic.
- Updates `tests/webtorrent-regression.test.mjs` to verify that webseeds are counted as peers and result in a healthy state with reason "peer".

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 18:40:23 +00:00
thePR0M3TH3AN c6e7a64e73 example 2026-02-01 13:21:48 -05:00