Commit Graph
4774 Commits
Author SHA1 Message Date
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
thePR0M3TH3AN 85e24beabf Merge pull request #2052 from PR0M3TH3AN/codex/update-conversation-focus-handling-in-profilemodalcontroller
Sync focused DM conversation on default selection and DM shell render
2026-02-01 12:57:29 -05:00
thePR0M3TH3AN ee3923f169 Update DM focus on default selection 2026-02-01 12:57:04 -05:00
thePR0M3TH3AN 7fb817de7f Merge pull request #2051 from PR0M3TH3AN/codex/refactor-renderprofilemessages-for-two-phase-rendering
Render DM threads before profile hydration
2026-02-01 12:36:48 -05:00
thePR0M3TH3AN b1418d02e5 Render DM threads before profile hydration 2026-02-01 12:36:16 -05:00
thePR0M3TH3AN 9038bf6ba5 Merge pull request #2050 from PR0M3TH3AN/codex/add-webseed-url-handling-for-playback
Merge hosted URL and magnet `ws=` webseeds into WebTorrent fallback
2026-02-01 12:23:13 -05:00
thePR0M3TH3AN 83dd3a9738 Add magnet webseeds to torrent fallback 2026-02-01 12:23:02 -05:00
thePR0M3TH3AN c646d7355c Merge pull request #2049 from PR0M3TH3AN/codex/update-timeoutid-handler-in-probepeers
Use webseed-aware peer counts for probePeers timeout
2026-02-01 12:20:20 -05:00
thePR0M3TH3AN cf3631c4c8 Use peer counts in probePeers timeout 2026-02-01 12:19:55 -05:00
thePR0M3TH3AN 2f5a325695 Merge pull request #2048 from PR0M3TH3AN/codex/adjust-handlecardvisible-logic-for-webseedonly
Handle webseed-only probe results in grid health badges
2026-02-01 12:14:45 -05:00
thePR0M3TH3AN 429df6e205 Handle webseed-only probe results 2026-02-01 12:14:35 -05:00
thePR0M3TH3AN 7ef2c6e926 Merge pull request #2047 from PR0M3TH3AN/codex/fix-blocked-resource-error
Fix duplicate snapshot declaration in nostr client persistence
2026-02-01 12:06:42 -05:00
thePR0M3TH3AN b802867f93 Fix nostr cache persistence snapshot 2026-02-01 12:06:22 -05:00
thePR0M3TH3AN bd377ed424 Merge pull request #2046 from PR0M3TH3AN/ai/performance-events-cache-dirty-tracking-5412442767823742174
⚡ Optimize event persistence with dirty state tracking (8x speedup)
2026-02-01 12:01:02 -05:00
thePR0M3TH3AN 1fc9859798 Merge branch 'unstable' into ai/performance-events-cache-dirty-tracking-5412442767823742174 2026-02-01 12:00:52 -05:00
thePR0M3TH3AN 24931148b7 Merge pull request #2045 from PR0M3TH3AN/ai/align-docs-code-11869612789191754100
📘 Align development docs with codebase behavior
2026-02-01 12:00:23 -05:00
thePR0M3TH3AN a21882bb3d Merge branch 'unstable' into ai/align-docs-code-11869612789191754100 2026-02-01 12:00:11 -05:00
thePR0M3TH3AN ba7edacf68 Merge pull request #2043 from PR0M3TH3AN/ai/optimize-events-cache-persistence-7314295839012727690
⚡ Optimize events cache persistence with dirty tracking
2026-02-01 11:59:45 -05:00
thePR0M3TH3AN 43a977da61 Merge branch 'unstable' into ai/optimize-events-cache-persistence-7314295839012727690 2026-02-01 11:59:25 -05:00
thePR0M3TH3AN 2e6a072988 Merge pull request #2044 from PR0M3TH3AN/ai/docs-alignment-14321450681939854377
📘 Align development docs with codebase behavior
2026-02-01 11:59:08 -05:00
thePR0M3TH3AN be7137c447 Merge branch 'unstable' into ai/docs-alignment-14321450681939854377 2026-02-01 11:58:57 -05:00
google-labs-jules[bot]andPR0M3TH3AN 18bb9c244e Fix webtorrent-regression.test.mjs failures
- Added import of `setup-localstorage.mjs` to polyfill `self` required by `webtorrent.min.js`.
- Updated `MockTorrent` to simulate webseed `wire` events, ensuring `probePeers` logic (which listens for wires) functions correctly in tests.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 16:55:15 +00:00
google-labs-jules[bot]andPR0M3TH3AN c82ab2d490 Optimize EventsCacheStore persistence with dirty state tracking
Implemented `dirtyEventIds` and `dirtyTombstones` in `NostrClient` to track only modified items.
Updated `EventsCacheStore.persistSnapshot` to accept these dirty sets and iterate only over changed items, skipping the O(N) serialization loop for unchanged data.
Added heuristic to skip deletion scan if the dataset size has not decreased.
Optimized `NostrClient` methods (`flushEventBuffer`, `deleteAllVersions`, `fetchVideos`, etc.) to flag modified events.
Updated `nostr-delete-flow.test.mjs` to use valid hex IDs for NIP-compliant testing.

Benchmark results (5000 items, single update):
- Before: ~19ms (O(N))
- After: ~2ms (O(1))

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 16:50:28 +00:00
google-labs-jules[bot]andPR0M3TH3AN a7c752a6af fix(test): mock wire event in webtorrent regression test
Simulates a 'wire' event in MockWebTorrent when a webseed is present,
ensuring probePeers correctly identifies the stream as healthy.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 16:43:15 +00:00
google-labs-jules[bot]andPR0M3TH3AN a3cc4a7456 docs: align build instructions and lint scope with codebase behavior
Updates CONTRIBUTING.md and README.md to accurately reflect that:
- `npm start` builds to and serves the `dist/` directory.
- `npm run format` targets CSS, HTML, MD, and config (not JS logic).
- `npm run lint` targets styles, tokens, and hex codes (no ESLint).
- Manual build steps should serve `dist` via `npx serve dist`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 16:37:07 +00:00
google-labs-jules[bot]andPR0M3TH3AN 640dee8c0b test: aggressively increase timeout for webtorrent regression
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 16:32:05 +00:00
google-labs-jules[bot]andPR0M3TH3AN f03ddd90a0 test: ensure webtorrent regression test is robust against ci flakiness
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 16:28:46 +00:00
google-labs-jules[bot]andPR0M3TH3AN ac23475b4a fix(ci): instrument webtorrent logic to debug flaky regression test
- Add detailed logging inside `js/webtorrent.js` (guarded by `NODE_ENV=test`) to inspect the state of `peers`, `hasWebSeed`, and `webseedOnly` when a probe times out.
- This is intended to diagnose why `webseedOnly` evaluates to false in CI despite logs indicating `hasExplicitWebSeed` is true.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 16:25:04 +00:00
google-labs-jules[bot]andPR0M3TH3AN 80dd5dcade fix(test): add debug logging and increase timeout in webtorrent regression test
- Increase `timeoutMs` in `tests/webtorrent-regression.test.mjs` from 50ms to 200ms to reduce flakiness in CI environments.
- Add debug logging to `js/webtorrent.js` (guarded by `NODE_ENV === 'test'`) to inspect `probePeers` inputs and `client.add` errors, helping diagnose why `webseedOnly` detection might fail in CI.
- Log failure details in `tests/webtorrent-regression.test.mjs` if assertion fails.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 16:19:16 +00:00
google-labs-jules[bot]andPR0M3TH3AN 1bbaac85fd test: increase timeout for webtorrent regression test
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 16:17:36 +00:00
google-labs-jules[bot]andPR0M3TH3AN 060e87dada docs: align development setup guide with build reality
- Update `CONTRIBUTING.md` to detail the behavior of `npm run build`, specifically that it executes `scripts/build-dist.mjs` and copies an allowlist of files/directories to `dist/`.
- Validate project health via `npm run lint`, `scripts/agent/validate-events.mjs`, and unit tests.
- Confirm `README.md` correctly links to `CONTRIBUTING.md` for detailed developer setup.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 16:12:13 +00:00
google-labs-jules[bot]andPR0M3TH3AN 912bf85499 optimize: track dirty events to speed up cache persistence
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 16:11:57 +00:00
thePR0M3TH3AN f68c407771 Merge pull request #2042 from PR0M3TH3AN/codex/update-streamvideo-to-add-web-seeds
Explicitly add web seeds to torrents after creation in streamVideo
2026-02-01 11:05:58 -05:00
thePR0M3TH3AN 3118773621 Add explicit web seeds to torrent streams 2026-02-01 11:05:30 -05:00
thePR0M3TH3AN d38fd52d00 Merge pull request #2041 from PR0M3TH3AN/codex/update-torrentclient.probepeers-for-webseed-wires
Handle web seed peers in torrent probes
2026-02-01 11:03:39 -05:00
thePR0M3TH3AN e022f0f633 Handle web seed peers in torrent probe 2026-02-01 11:03:19 -05:00
thePR0M3TH3AN f66e98f969 Merge pull request #2040 from PR0M3TH3AN/ai/fix-webseed-health-and-bootstrap-1140772652148172709
Fix WebTorrent webseed health check and bootstrap behavior
2026-02-01 10:52:02 -05:00
thePR0M3TH3AN 007bbcf8aa Merge pull request #2039 from PR0M3TH3AN/ai/fix-dm-loading-and-notifications-15821194332486099528
Fix DM opportunistic loading and notification cache reliability
2026-02-01 10:50:55 -05:00
google-labs-jules[bot]andPR0M3TH3AN 7e21386bd0 fix(webtorrent): correct webseed availability check and force bootstrap
This change addresses two issues with WebTorrent webseed handling:
1.  **Grid Availability Check:** Modified `js/gridHealth.js` to correctly classify torrents with only webseeds as "healthy" and report 1 peer (instead of 0) so the UI availability check passes.
2.  **Video Player Bootstrap:** Modified `js/webtorrent.js` (`probePeers` and `streamVideo`) to explicitly append provided webseed URLs (`urlList`) to the magnet link as `&ws=` parameters. This forces the WebTorrent client to recognize and use these webseeds as initial peers for bootstrapping the swarm.

Tested via `tests/verification/verify_webseed_fix.mjs` (logic verification).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 15:49:46 +00:00
google-labs-jules[bot]andPR0M3TH3AN 77cd03b2f7 Refactor DM loading to be opportunistic and serialize notification updates
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 15:47:54 +00:00
thePR0M3TH3AN d639d0f2df Merge pull request #2038 from PR0M3TH3AN/ai/fix-css-loading-4566247044884119741
Fix CSS loading and start script configuration
2026-02-01 10:18:01 -05:00
google-labs-jules[bot]andPR0M3TH3AN a0a5ed7e78 Fix CSS loading by removing force flag from redirects and updating start script
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 14:31:30 +00:00
thePR0M3TH3AN 5a67774011 Merge pull request #2023 from PR0M3TH3AN/fix-webtorrent-webseed-regression-10274894627332192935
Fix WebTorrent webseed stream health check regression
2026-02-01 09:14:43 -05:00
google-labs-jules[bot]andPR0M3TH3AN 88d30970ef Fix CI failure in hashtag-preferences test
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 14:14:02 +00:00
google-labs-jules[bot]andPR0M3TH3AN 2f33992192 Fix dependencies (jsdom/nostr-tools conflict) and WebTorrent regression
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 13:32:00 +00:00
thePR0M3TH3AN d35de4d743 Merge pull request #2036 from PR0M3TH3AN/ai/refactor-notification-controller-20231027-2601673227327805546
refactor(ai): extract notification logic to NotificationController
2026-02-01 08:01:22 -05:00
thePR0M3TH3AN 31d1775d90 Merge pull request #2035 from PR0M3TH3AN/ai/ci-health-20241028-10335292326695405989
chore(ai): CI health fixes (flaky tests)
2026-02-01 08:01:04 -05:00