From e25d79b2a23d94ecc6510b9066eea93f162e7d1e Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 9 Feb 2026 03:03:56 +0000 Subject: [PATCH] Fix CI failures in NostrClient and SignerManager - Export `resolveSignerCapabilities` from `SignerManager` and import in `NostrClient` to fix ReferenceError in `sendDirectMessage`. - Initialize `RelayBatchFetcher` in `NostrClient` constructor to fix TypeError in `fetchListIncrementally`. - Implement `registerPrivateKeySigner` in `NostrClient` to fix TypeError in signer tests. Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- js/nostr/client.js | 11 ++++++++++- js/nostr/managers/SignerManager.js | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/js/nostr/client.js b/js/nostr/client.js index 1084c6ac..5974e31b 100644 --- a/js/nostr/client.js +++ b/js/nostr/client.js @@ -214,7 +214,8 @@ import { queueSignEvent } from "./signRequestQueue.js"; import { EventsMap } from "./eventsMap.js"; import { PersistenceManager } from "./managers/PersistenceManager.js"; import { ConnectionManager } from "./managers/ConnectionManager.js"; -import { SignerManager } from "./managers/SignerManager.js"; +import { SignerManager, resolveSignerCapabilities } from "./managers/SignerManager.js"; +import { RelayBatchFetcher } from "./relayBatchFetcher.js"; function normalizeProfileFromEvent(event) { if (!event || !event.content) return null; @@ -580,6 +581,7 @@ export class NostrClient { constructor() { this.connectionManager = new ConnectionManager(this); this.signerManager = new SignerManager(this); + this.relayBatchFetcher = new RelayBatchFetcher(this); /** * @type {Map} @@ -2907,6 +2909,13 @@ export class NostrClient { * @returns {Promise} The signed and published edit event. * @throws {Error} If permission denied, ownership mismatch, or publish failure. */ + registerPrivateKeySigner({ privateKey, pubkey }) { + const adapter = 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); } diff --git a/js/nostr/managers/SignerManager.js b/js/nostr/managers/SignerManager.js index e794c862..267d62eb 100644 --- a/js/nostr/managers/SignerManager.js +++ b/js/nostr/managers/SignerManager.js @@ -53,7 +53,7 @@ import { queueSignEvent } from "../signRequestQueue.js"; import { signEventWithPrivateKey } from "../publishHelpers.js"; import { ensureNostrTools, getCachedNostrTools } from "../toolkit.js"; -function resolveSignerCapabilities(signer) { +export function resolveSignerCapabilities(signer) { const fallback = { sign: false, nip44: false,