Commit Graph
5359 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN ab72036a4f test(ai): add unit tests for authUtils, decryptionSchemeCache, videoPayloadBuilder (agent)
Added focused unit tests for three core modules to improve coverage:
- `js/services/authUtils.js`: Tested `normalizeProviderId` and `normalizeAuthType`.
- `js/nostr/decryptionSchemeCache.js`: Tested caching logic, TTL expiration, and cache clearing.
- `js/nostr/videoPayloadBuilder.js`: Tested payload extraction and event preparation, including NIP-71 metadata handling.

Tests use `node:test` and `node:assert/strict` and are integrated into the existing test suite.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 11:15:09 +00:00
thePR0M3TH3AN 2ca348bdac Merge pull request #2343 from PR0M3TH3AN/refactor-client-send-dm-1580382256443769824
Refactor sendDirectMessage to use strategy pattern for NIP-04/17
2026-02-11 05:49:50 -05:00
google-labs-jules[bot]andPR0M3TH3AN 8027ec9b2b Refactor sendDirectMessage to use strategy pattern for NIP-04/17
Extracted NIP-17 and NIP-04 logic into separate private methods `_sendNip17DirectMessage` and `_sendNip04DirectMessage` to reduce complexity and improve readability of `sendDirectMessage`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 10:46:17 +00:00
thePR0M3TH3AN 5d43bf8fa7 Merge pull request #2342 from PR0M3TH3AN/ai/onboarding-20250211-18093161619302896792
docs(ai): improve onboarding steps
2026-02-11 05:28:54 -05:00
thePR0M3TH3AN 90fad893bf Merge pull request #2341 from PR0M3TH3AN/refactor-events-cache-store-7678386515103062591
🧹 Refactor persistSnapshot in EventsCacheStore
2026-02-11 05:28:34 -05:00
thePR0M3TH3AN 96f1938004 Merge pull request #2337 from PR0M3TH3AN/fix/security-remove-unsafe-logging-997674150393261615
🔒 Remove vulnerable unused logging function
2026-02-11 05:27:52 -05:00
google-labs-jules[bot]andPR0M3TH3AN 13c626b5b6 docs(ai): improve onboarding steps
Audited the onboarding process and confirmed all steps pass.
Added .npmrc with engine-strict=true to enforce Node.js >=22 requirement.
Updated CONTRIBUTING.md and README.md to explicitly mention the Node version requirement and its enforcement.
Added artifacts/ONBOARDING_REPORT.md with the audit report.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 08:34:23 +00:00
google-labs-jules[bot]andPR0M3TH3AN e697d89946 Refactor persistSnapshot to use generic diffAndStore helper
Extracts the duplicate logic for diffing and persisting events and tombstones in `EventsCacheStore` into a private `_diffAndStore` helper method. This improves maintainability and reduces code duplication.

Also adds a new test file `tests/nostr/eventsCacheStore.test.mjs` to verify the functionality of `EventsCacheStore` using `fake-indexeddb`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 04:27:35 +00:00
thePR0M3TH3AN 58412220fc Merge pull request #2340 from PR0M3TH3AN/refactor-edit-video-4906399848004884511
Refactor editVideo method for better maintainability
2026-02-10 23:14:34 -05:00
google-labs-jules[bot]andPR0M3TH3AN 58fc143c66 Refactor editVideo into validation, prep, and publish steps
Split the long `editVideo` method in `js/nostr/client.js` into three
distinct parts:
1. `_validateEditPrerequisites`: Handles input validation and state checks.
2. `prepareVideoEditPayload`: Existing helper for payload construction.
3. `_signAndPublishEdit`: Handles signing and network operations.

This improves maintainability and readability by separating concerns.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 04:13:50 +00:00
thePR0M3TH3AN b1f06695a6 Merge pull request #2339 from PR0M3TH3AN/suppress-nip17-relay-warning-3701543430430345832
Add config to suppress NIP-17 relay warnings
2026-02-10 23:06:50 -05:00
google-labs-jules[bot]andPR0M3TH3AN 5ca378bb96 Add ENABLE_NIP17_RELAY_WARNING config to suppress privacy warnings
Added a new configuration variable `ENABLE_NIP17_RELAY_WARNING` to `config/instance-config.js` (defaulting to `false`) to control the display of NIP-17 relay fallback warnings. Updated `js/ui/profileModalController.js` and `js/app.js` to respect this setting.

This change allows instance operators to disable "Privacy warning: direct messages are using your default relays because no NIP-17 relay list is available" and related notifications.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 04:05:36 +00:00
thePR0M3TH3AN fd8324374e Merge pull request #2338 from PR0M3TH3AN/fix-missing-build-hash-error-handling-1559754443002918677
Make version injection failure fatal in build-dist.mjs
2026-02-10 23:02:04 -05:00
google-labs-jules[bot]andPR0M3TH3AN 349fa11422 fix(scripts): make version injection failure fatal in build-dist.mjs
Previously, `scripts/build-dist.mjs` caught errors during version injection and logged them but allowed the build to complete with a success exit code. This masked issues in CI/CD environments (like 4everland) where version injection failed silently, leading to deployments without version hashes.

This change modifies `injectVersionInfo` to `process.exit(1)` upon failure, ensuring that any issue with version injection halts the build pipeline and surfaces the error in the logs.

Tested locally by simulating injection failure (verified exit code 1) and by running a standard build (verified success and correct injection).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 03:57:45 +00:00
google-labs-jules[bot]andPR0M3TH3AN 99fbe96f5c security: Remove unused vulnerable logging function in NostrClient
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 03:57:24 +00:00
thePR0M3TH3AN ca57f9caaf Merge pull request #2336 from PR0M3TH3AN/decompose-profile-modal-controller-5857031998313460612
Decompose ProfileModalController: Extract Wallet and Storage Controllers
2026-02-10 22:57:11 -05:00
thePR0M3TH3AN 2fd63b39e5 Merge pull request #2335 from PR0M3TH3AN/refactor-numeric-constants-unstable-17302506405327886541
Refactor numeric constants to centralized module
2026-02-10 22:56:45 -05:00
thePR0M3TH3AN 0deba74ee1 Merge pull request #2334 from PR0M3TH3AN/security/migrate-innerhtml-1114713630074846257
[security] Migrate innerHTML in profileModalController.js
2026-02-10 22:55:06 -05:00
thePR0M3TH3AN 09fbc7330b Merge pull request #2333 from PR0M3TH3AN/audit-report-unstable-11659156663651364283
Audit Report for Unstable Branch
2026-02-10 22:54:12 -05:00
thePR0M3TH3AN 20115dee11 Merge pull request #2332 from PR0M3TH3AN/content-docs-audit-3706052772104384925
🌐 Align /content user docs with actual upload & contribution behavior
2026-02-10 22:53:53 -05:00
thePR0M3TH3AN 563c9fcc68 Merge pull request #2331 from PR0M3TH3AN/ai/ci-health-20260211-10843530064953127328
chore(ai): CI health fixes (flaky tests & lockfile)
2026-02-10 22:53:08 -05:00
thePR0M3TH3AN 9ec005868e Merge pull request #2330 from PR0M3TH3AN/ai/todo-triage-20240523-13260651508726397217
Triage TODOs and create issue for flaky test
2026-02-10 22:52:38 -05:00
google-labs-jules[bot]andPR0M3TH3AN 48d33f45eb [decompose] Extract Wallet and Storage controllers from ProfileModalController
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 03:30:40 +00:00
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
google-labs-jules[bot]andPR0M3TH3AN 8ca4a71240 [security] Migrate innerHTML in profileModalController.js
Replaced 26 instances of `innerHTML` assignment with safe DOM APIs (`textContent`, `replaceChildren`, `document.createElement`) in `js/ui/profileModalController.js`.
Updated the `scripts/check-innerhtml.mjs` baseline to reflect the reduction (from 27 to 1). The remaining instance loads a static HTML template.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 03:11:39 +00:00
google-labs-jules[bot]andPR0M3TH3AN eabcb1a475 Add audit report for unstable branch
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 03:06:19 +00:00
google-labs-jules[bot]andPR0M3TH3AN 311abee846 docs: align /content user docs with actual upload & contribution behavior
- Update `content/docs/guides/upload-content.md` to reflect current codebase and runtime behavior.
- Clarify automatic CORS configuration logic (via S3 `PutBucketCors`) and fallback manual steps.
- Add "Advanced Options (NIP-71)" section detailing `Content Warning`, `Duration`, `Summary`, `IMETA` (variants), `Web Seed`, `Torrent File`.
- Refine "Troubleshooting" section with exact error messages verified against `js/services/videoNotePayload.js`.
- Reiterate 2GB file size recommendation due to client-side hashing memory limits.
- Ensure accepted file types list matches HTML `accept` attribute in `components/upload-modal.html`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 02:39:28 +00:00
google-labs-jules[bot]andPR0M3TH3AN 69f475ab6b chore(ai): CI health fixes (flaky tests & lockfile)
- Fix `ReferenceError` in `tests/hashtag-preferences.test.mjs` by defining missing `permissionState` variable.
- Skip `tests/visual/overlay-layers.spec.ts` "mobile sidebar shares desktop rail behavior" as it is known to be flaky/timeout (documented in `issues/todo-moderation-tests.md`).
- Update `package-lock.json` via `npm install` to ensure consistency.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 02:12:10 +00:00
google-labs-jules[bot]andPR0M3TH3AN e858f5210f chore(ai): triage TODOs and create issue for flaky test
- Created `issues/todo-hashtag-preferences-unit-test.md` to document a flaky unit test in `tests/hashtag-preferences.test.mjs`.
- Generated `artifacts/todos.txt` with the scan results.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 01:13:14 +00:00
thePR0M3TH3AN 83d8023767 Merge pull request #2329 from PR0M3TH3AN/codex/update-ci-pipeline-for-deployment-verification
[ci] Gate release deploys on dist checks and deployed index verification
2026-02-10 17:20:57 -05:00
thePR0M3TH3AN 9992fc3acb [ci] verify deployed index artifact and enforce release checks 2026-02-10 17:20:42 -05:00
thePR0M3TH3AN b44683a38b Merge pull request #2328 from PR0M3TH3AN/codex/update-local-server-instructions
Codex-generated pull request
2026-02-10 17:17:26 -05:00
thePR0M3TH3AN 06118d290e docs: clarify local dist preview URL behavior 2026-02-10 17:17:11 -05:00
thePR0M3TH3AN 6fff162e0a Merge pull request #2327 from PR0M3TH3AN/codex/update-deployment-pipeline-for-dist-folder
[ci] Enforce dist-based deployment & verify deploy artifact
2026-02-10 17:15:47 -05:00
thePR0M3TH3AN 78f28105a9 ci/deploy: enforce dist artifact deployment settings 2026-02-10 17:12:34 -05:00
thePR0M3TH3AN acb3364d46 Merge pull request #2326 from PR0M3TH3AN/codex/document-local-server-setup-in-readme.md
Codex-generated pull request
2026-02-10 17:04:05 -05:00
thePR0M3TH3AN 6772501271 docs: clarify local dist serving URLs 2026-02-10 16:53:56 -05:00
thePR0M3TH3AN 19e5919d35 Merge pull request #2325 from PR0M3TH3AN/codex/update-deployment-pipeline-for-dist-directory
[ci] Enforce dist deploy verification and HTML cache purge
2026-02-10 16:52:23 -05:00
thePR0M3TH3AN 6fce210044 [ci] verify dist deploy artifact and force HTML cache purge 2026-02-10 16:52:05 -05:00
thePR0M3TH3AN 2e50c7a58f Merge pull request #2324 from PR0M3TH3AN/fix-broken-tailwind-in-dist-6345925489105674383
Fix broken Tailwind CSS in dist build
2026-02-10 16:37:07 -05:00
google-labs-jules[bot]andPR0M3TH3AN bf49ed7e3f Fix broken Tailwind CSS in dist build by bundling imports
- Switched from `tailwindcss` CLI to `postcss-cli` in `build:css` script to robustly handle PostCSS plugins.
- Installed `postcss-import` and `postcss-cli` as dev dependencies.
- Updated `postcss.config.cjs` to include `postcss-import` before `tailwindcss`.
- Removed `--minify` from `build:css` command as `cssnano` was stripping critical CSS variables from `tokens.css`.
- This ensures `tokens.css` is correctly inlined into `tailwind.generated.css`, fixing undefined variables that caused broken styles in the distribution build.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-10 21:31:20 +00:00
thePR0M3TH3AN dea1a2aedf Merge pull request #2323 from PR0M3TH3AN/fix-version-injection-7871469918057559176
Robust version hash injection
2026-02-10 16:08:51 -05:00
google-labs-jules[bot]andPR0M3TH3AN 53c0e9e8f4 Fix: robust version hash injection in build process
Replaced the fragile regex-based version injection in `scripts/build-dist.mjs` with a robust placeholder method.

- Added `<!-- VERSION_INFO -->` placeholder to `index.html`.
- Updated `scripts/build-dist.mjs` to target the placeholder, while retaining regex fallback for safety.
- Ensures version info is reliably injected during local builds regardless of code formatting.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-10 21:05:37 +00:00
thePR0M3TH3AN 93d9bb7585 Merge pull request #2322 from PR0M3TH3AN/perf-feed-tag-caching-7931834874140558598
⚡ Optimize feed engine tag extraction with caching
2026-02-10 15:42:47 -05:00
thePR0M3TH3AN 5cdfc2116f Merge pull request #2321 from PR0M3TH3AN/ai/load-test-20260210-17552173328410894031
feat: Add load test report (2026-02-10)
2026-02-10 15:42:13 -05:00
google-labs-jules[bot]andPR0M3TH3AN 6f49a05302 feat(perf): Optimize feed tag extraction with caching
- Extracted `getVideoTags` to `js/feedEngine/utils.js` with `WeakMap` caching.
- Updated `js/feedEngine/stages.js` and `js/feedEngine/kidsScoring.js` to use the cached utility.
- Removed redundant `collectVideoTags` and `normalizeTagSetFromVideo` functions.
- Added `benchmarks/feed_tags.mjs` to measure performance (approx 25x speedup in tight loops).
- Updated `hasDisinterestedTag` in `utils.js` to use the new utility.

This reduces object allocation and repeated string normalization during feed processing.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-10 19:44:30 +00:00
google-labs-jules[bot]andPR0M3TH3AN cbd892122c feat: Add load test report for 2026-02-10
- Executed load test with 1000 clients, 0.1 rate, 60s duration.
- Verified throughput (~83 events/sec) and latency (p95 < 1ms).
- No errors or bottlenecks detected.
- Report saved to artifacts/load-report-20260210.json.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-10 19:30:35 +00:00
thePR0M3TH3AN d951e74920 Merge pull request #2318 from PR0M3TH3AN/feed-engine-optimization-13596960870183920240
⚡ Optimize feed engine normalization overhead
2026-02-10 14:25:27 -05:00
thePR0M3TH3AN 8e33bedc52 Merge pull request #2319 from PR0M3TH3AN/fix/known-issues-popover-test-13756458544495028043
Update KNOWN_ISSUES and resolve popover flip bug
2026-02-10 14:24:55 -05:00
thePR0M3TH3AN d05d249870 Merge pull request #2317 from PR0M3TH3AN/align-development-docs-11513914336170601576
📘 Align development docs with codebase behavior
2026-02-10 14:24:30 -05:00