mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
fix: remediate known issues and bugs
- Installed missing devDependencies (`jsdom`, `playwright`, `fake-indexeddb`). - Fixed SyntaxError in `js/nostr/managers/SignerManager.js`. - Fixed bug in `js/nostr/client.js` where `registerPrivateKeySigner` was defined twice, preventing `sessionActor` initialization. - Updated `KNOWN_ISSUES.md` and related issue docs. - Verified popover bug status (still present, skipped). Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
74d15f2946
commit
8bcd7261ab
5 files changed
+16
-64
No files matched your search
+2
-17
@@ -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.
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
+11
-15
@@ -2958,20 +2958,6 @@ export class NostrClient {
|
||||
* @returns {Promise<import("nostr-tools").Event>} 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) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user