From 730618efa8baff5796dab50866d4aaa53ddb0ece Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 16:20:13 +0000 Subject: [PATCH 1/3] fix(nostr): correctly resolve signer capabilities when methods are present This fixes a critical issue where valid NIP-07 signers were treated as incapable of NIP-44/NIP-04 operations if their initial `capabilities` flag was false, even if the necessary methods (e.g., `nip44Decrypt`) were subsequently added or already present. This addresses errors like "Gift wrap events require a NIP-44 decryptor" for users with valid extensions. Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- js/nostr/client.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/js/nostr/client.js b/js/nostr/client.js index 7ad2f43d..fcdb54fb 100644 --- a/js/nostr/client.js +++ b/js/nostr/client.js @@ -307,19 +307,16 @@ function resolveSignerCapabilities(signer) { return { sign: - typeof capabilities.sign === "boolean" - ? capabilities.sign - : typeof signer.signEvent === "function", + (typeof capabilities.sign === "boolean" && capabilities.sign) || + typeof signer.signEvent === "function", nip44: - typeof capabilities.nip44 === "boolean" - ? capabilities.nip44 - : typeof signer.nip44Encrypt === "function" || - typeof signer.nip44Decrypt === "function", + (typeof capabilities.nip44 === "boolean" && capabilities.nip44) || + typeof signer.nip44Encrypt === "function" || + typeof signer.nip44Decrypt === "function", nip04: - typeof capabilities.nip04 === "boolean" - ? capabilities.nip04 - : typeof signer.nip04Encrypt === "function" || - typeof signer.nip04Decrypt === "function", + (typeof capabilities.nip04 === "boolean" && capabilities.nip04) || + typeof signer.nip04Encrypt === "function" || + typeof signer.nip04Decrypt === "function", }; } From 991d166254cdf82b73fb9107412a6e6fdbe83196 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 16:26:31 +0000 Subject: [PATCH 2/3] fix(tests): remove duplicate variable declaration in profile batch fetcher test This fixes a syntax error in `tests/app-batch-fetch-profiles.test.mjs` where `originalReadRelays` was declared twice, causing the CI `agent-review` job (and subsequent deploy checks) to fail. The underlying NIP-07 decryption fix (correctly resolving signer capabilities) remains in place from the previous commit. Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- tests/app-batch-fetch-profiles.test.mjs | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/app-batch-fetch-profiles.test.mjs b/tests/app-batch-fetch-profiles.test.mjs index 508728bb..361a46f7 100644 --- a/tests/app-batch-fetch-profiles.test.mjs +++ b/tests/app-batch-fetch-profiles.test.mjs @@ -55,9 +55,6 @@ test("batchFetchProfiles handles fast and failing relays", async () => { const originalWriteRelays = Array.isArray(nostrClient.writeRelays) ? [...nostrClient.writeRelays] : nostrClient.writeRelays; - const originalReadRelays = Array.isArray(nostrClient.readRelays) - ? [...nostrClient.readRelays] - : nostrClient.readRelays; const originalPool = nostrClient.pool; const poolListCalls = []; From cfb395ff1a9ef9d19d59ddece304ad2278a2e5b6 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 16:36:27 +0000 Subject: [PATCH 3/3] fix(tests): update expected relay health state in unit test This update aligns `tests/services/relay-health-service.test.mjs` with the actual state object structure used in `RelayHealthService`, which now includes `consecutiveFailures` and `lastUserLogAt` properties. This fixes a CI failure in the `agent-review` job. The previous fix for `tests/app-batch-fetch-profiles.test.mjs` (duplicate variable) is also included in this branch history. Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- tests/services/relay-health-service.test.mjs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/services/relay-health-service.test.mjs b/tests/services/relay-health-service.test.mjs index 0d2ac973..1943423c 100644 --- a/tests/services/relay-health-service.test.mjs +++ b/tests/services/relay-health-service.test.mjs @@ -57,8 +57,10 @@ test("RelayHealthService: ensureRelayState creates default state", () => { connected: false, lastLatencyMs: null, errorCount: 0, + consecutiveFailures: 0, lastCheckedAt: null, lastErrorAt: null, + lastUserLogAt: null, }); });