diff --git a/KNOWN_ISSUES.md b/KNOWN_ISSUES.md index e8e9be00..b4529fbe 100644 --- a/KNOWN_ISSUES.md +++ b/KNOWN_ISSUES.md @@ -1,22 +1,7 @@ # Known Issues -## Environment - -### Missing Dependencies - -The current development environment is missing critical `devDependencies` (`jsdom`, `playwright`, `fake-indexeddb`), preventing many test suites from running. - -- **Affected:** `tests/app/channel-profile-moderation.test.mjs`, `test:dm:unit`, `test:dm:integration`, `test:e2e`, `test:visual`. -- **Reference:** `issues/test-env-deps.md` -- **Last checked:** 2026-02-08 - ## Tests -### Unit Tests - -- `npm run test:unit` generally passes, but `tests/app/channel-profile-moderation.test.mjs` fails due to missing `jsdom`. -- Timeouts may occur in resource-constrained environments (like CI) when running the full suite serially. CI workflows use sharding (`test:unit:shardX`) to mitigate this. Targeted testing (`test:dm:unit`, `test:dm:integration`) is recommended for local development focus but currently fails due to missing `fake-indexeddb`. (Last checked: 2026-02-08) - ### Skipped Tests The following tests are skipped due to flakiness or environmental issues and should be investigated: @@ -24,9 +9,9 @@ The following tests are skipped due to flakiness or environmental issues and sho - `tests/e2e/popover.spec.ts`: `keeps the bottom-right grid menu inside the viewport` - **Issue:** Visual regression layout issue: Floating UI `flip` middleware fails to respect viewport boundary in constrained height scenarios. - **Reference:** `issues/popover-flip-bug.md` - - **Status:** Verification attempted 2026-02-08 but failed due to missing `@playwright/test`. (Verified 2025-02-23, fix attempt failed.) + - **Status:** Verified 2026-02-08. Fix attempt failed previously. Test is skipped. ### Visual Regression Tests (`test:visual`) - **Artifact Retention**: Visual tests are configured to retain screenshots, traces, and videos on failure to assist with debugging. These artifacts can be found in `artifacts/test-results/`. -- **Note:** `test:visual` currently fails due to missing `@playwright/test`. +- **Note:** Visual tests are passing as of 2026-02-08, except for the skipped popover test. diff --git a/issues/popover-flip-bug.md b/issues/popover-flip-bug.md index f2332e22..1c6650b3 100644 --- a/issues/popover-flip-bug.md +++ b/issues/popover-flip-bug.md @@ -17,12 +17,13 @@ The popover (using Floating UI `flip` middleware) fails to respect viewport boun ## Test Case -- `tests/e2e/popover.spec.ts`: "keeps the bottom-right grid menu inside the viewport" (skipped). +- `tests/e2e/popover.spec.ts`: `keeps the bottom-right grid menu inside the viewport` (skipped). ## History - **2025-02-23**: Verification failed. Fix attempt failed. - **2026-02-08**: Verification attempted but failed due to missing environment dependencies (`@playwright/test`). +- **2026-02-08**: Environment fixed. Test validated as still failing (skipped). ## Possible Causes diff --git a/issues/test-env-deps.md b/issues/test-env-deps.md deleted file mode 100644 index 022a15a0..00000000 --- a/issues/test-env-deps.md +++ /dev/null @@ -1,30 +0,0 @@ -# Test Environment Missing Dependencies - -## Problem - -The current development environment is missing several `devDependencies` that are listed in `package.json`. This prevents running certain test suites. - -## Affected Dependencies - -- `jsdom`: Required for `tests/app/channel-profile-moderation.test.mjs`. -- `fake-indexeddb`: Required for `test:dm:unit` and `test:dm:integration`. -- `@playwright/test` (and `playwright`): Required for E2E tests (`test:e2e`, `tests/e2e/popover.spec.ts`, etc.) and visual regression tests (`test:visual`). - -## Impact - -- `npm run test:unit` fails partially (`tests/app/channel-profile-moderation.test.mjs` fails with `ERR_MODULE_NOT_FOUND`). -- `npm run test:dm:unit` fails completely. -- `npm run test:dm:integration` fails completely. -- `npm run test:e2e` fails completely. -- `npm run test:visual` fails completely. - -## Notes - -- `npm install` is restricted in this environment, preventing easy re-installation. -- This issue was verified on 2026-02-08. - -## Tags - -- environment -- testing -- dependencies diff --git a/js/nostr/client.js b/js/nostr/client.js index accbd0be..e11724b2 100644 --- a/js/nostr/client.js +++ b/js/nostr/client.js @@ -2958,20 +2958,6 @@ export class NostrClient { * @returns {Promise} The signed and published edit event. * @throws {Error} If permission denied, ownership mismatch, or publish failure. */ - /** - * Registers a private key signer and sets it as active. - * - * @param {object} params - * @param {string} params.privateKey - Hex-encoded private key. - * @param {string} params.pubkey - Hex-encoded public key. - */ - async registerPrivateKeySigner({ privateKey, pubkey }) { - const adapter = await createNsecAdapter({ privateKey, pubkey }); - this.signerManager.setActiveSigner(adapter); - // Also set session actor for worker-based encryption - this.sessionActor = { privateKey, pubkey, source: "nsec" }; - } - async ensureActiveSignerForPubkey(pubkey) { return this.signerManager.ensureActiveSignerForPubkey(pubkey); } @@ -3003,7 +2989,17 @@ export class NostrClient { } async registerPrivateKeySigner(params) { - return this.signerManager.registerPrivateKeySigner(params); + const pubkey = await this.signerManager.registerPrivateKeySigner(params); + // Explicitly update the session actor so worker-based encryption can use the private key + // even if it wasn't persisted by the SignerManager. + if (params && typeof params.privateKey === "string") { + this.sessionActor = { + privateKey: params.privateKey, + pubkey: pubkey, + source: "nsec", + }; + } + return pubkey; } installNip46Client(rpcClient, options) { diff --git a/js/nostr/managers/SignerManager.js b/js/nostr/managers/SignerManager.js index c6bebad2..13ec4b91 100644 --- a/js/nostr/managers/SignerManager.js +++ b/js/nostr/managers/SignerManager.js @@ -452,7 +452,7 @@ export class SignerManager { return { ok: false, error: "extension-missing" }; } - const extension = typeof window !== "undefined" ? window.nostr : null; + extension = typeof window !== "undefined" ? window.nostr : null; const message = resolvePermissionStatusMessage(missing, context); try {