Merge pull request #2275 from PR0M3TH3AN/fix-ci-failures-2862467126667224811

Fix CI failures and clean up NostrClient duplicates
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2026-02-09 20:13:52 -05:00
commit f0633910d6
2 files changed
+9 -73

No files matched your search

+9 -27
View File
@@ -220,7 +220,6 @@ import {
hydrateExtensionSignerCapabilities,
attachNipMethodAliases,
} from "./managers/SignerManager.js";
import { RelayBatchFetcher } from "./relayBatchFetcher.js";
import {
prepareVideoPublishPayload,
prepareVideoMirrorOptions,
@@ -475,11 +474,8 @@ export class NostrClient {
this.rootCreatedAtByRoot = new Map();
this.dirtyEventIds = new Set();
this.dirtyTombstones = new Set();
this.persistenceManager = new PersistenceManager(this);
this.syncMetadataStore = new SyncMetadataStore();
this.relayBatchFetcher = new RelayBatchFetcher(this);
this.nip71Cache = new Map();
this.watchHistory = createWatchHistoryManager({
@@ -628,8 +624,6 @@ export class NostrClient {
get unreachableRelays() { return this.connectionManager.unreachableRelays; }
get extensionPermissionCache() { return this.signerManager.extensionPermissionCache; }
/**
* Records a deletion timestamp for a video identifier (Tombstoning).
*
@@ -768,17 +762,6 @@ export class NostrClient {
}
}
resolveEventDTag(event, fallbackEvent = null) {
if (event && typeof event === "object") {
const dTag = getDTagValueFromTags(event.tags);
if (dTag) return dTag;
}
if (fallbackEvent && typeof fallbackEvent === "object") {
return getDTagValueFromTags(fallbackEvent.tags);
}
return null;
}
getActiveKey(video) {
return getActiveKey(video);
}
@@ -1048,16 +1031,6 @@ export class NostrClient {
*
* @returns {Promise<void>} Resolves when the relay pool is initialized and connections are attempted.
*/
/**
* Main entry point for the client.
*
* 1. Restores local state from IndexedDB (Stale-While-Revalidate).
* 2. Initializes the relay connection pool.
* 3. Connects to configured relays.
* 4. Restores any persistent remote signer sessions.
*
* @returns {Promise<void>} Resolves after the initial relay connection attempt completes.
*/
async init() {
if (this.isInitialized) {
return;
@@ -2367,6 +2340,15 @@ export class NostrClient {
async registerPrivateKeySigner(opts) {
const adapter = await createNsecAdapter(opts);
this.signerManager.setActiveSigner(adapter);
if (opts.privateKey && typeof opts.privateKey === "string") {
this.sessionActor = {
pubkey: adapter.pubkey,
privateKey: opts.privateKey.trim().toLowerCase(),
source: "nsec",
};
}
return adapter;
}
-46
View File
@@ -1,46 +0,0 @@
→ Running tests/nostr/integration-remote-flow.test.mjs
VIEW RESULT ERROR: { ok: false, error: 'missing-actor' }
TAP version 13
# Subtest: nostr login + remote signing + publish + watch history integration
not ok 1 - nostr login + remote signing + publish + watch history integration
---
duration_ms: 60.800483
type: 'test'
location: '/app/tests/nostr/integration-remote-flow.test.mjs:52:1'
failureType: 'testCodeFailure'
error: |-
Expected values to be strictly equal:
false !== true
code: 'ERR_ASSERTION'
name: 'AssertionError'
expected: true
actual: false
operator: 'strictEqual'
stack: |-
TestContext.<anonymous> (file:///app/tests/nostr/integration-remote-flow.test.mjs:272:83)
async Test.run (node:internal/test_runner/test:1054:7)
async startSubtestAfterBootstrap (node:internal/test_runner/harness:296:3)
...
1..1
# tests 1
# suites 0
# pass 0
# fail 1
# cancelled 0
# skipped 0
# todo 0
# duration_ms 72.354406
file:///app/scripts/run-targeted-tests.mjs:44
reject(new Error(`${relativePath} failed with exit code ${code}`));
^
Error: tests/nostr/integration-remote-flow.test.mjs failed with exit code 1
at ChildProcess.<anonymous> (file:///app/scripts/run-targeted-tests.mjs:44:16)
at ChildProcess.emit (node:events:519:28)
at maybeClose (node:internal/child_process:1101:16)
at ChildProcess._handle.onexit (node:internal/child_process:304:5)
Node.js v22.22.0