From e1a62b911fdfe07f838e261910415ca13afba1a7 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Fri, 4 Sep 2026 01:17:58 -0300 Subject: [PATCH] close socket from failed connect. fixes https://github.com/nbd-wtf/nostr-tools/issues/550 --- abstract-relay.ts | 2 ++ jsr.json | 2 +- package.json | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/abstract-relay.ts b/abstract-relay.ts index be1af80..8db80e0 100644 --- a/abstract-relay.ts +++ b/abstract-relay.ts @@ -180,6 +180,7 @@ export class AbstractRelay { if (this.reconnectAttempts === 0) { this.skipReconnection = true } + this.ws?.close?.() this.handleHardClose('relay connection timed out') }, opts.timeout) } @@ -236,6 +237,7 @@ export class AbstractRelay { if (this.reconnectAttempts === 0) { this.skipReconnection = true } + this.ws?.close?.() this.handleHardClose('relay connection failed') } diff --git a/jsr.json b/jsr.json index f133628..3448866 100644 --- a/jsr.json +++ b/jsr.json @@ -1,6 +1,6 @@ { "name": "@nostr/tools", - "version": "2.25.1", + "version": "2.25.2", "exports": { ".": "./index.ts", "./core": "./core.ts", diff --git a/package.json b/package.json index 6d43f53..d91df9c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "type": "module", "name": "nostr-tools", - "version": "2.25.1", + "version": "2.25.2", "description": "Tools for making a Nostr client.", "repository": { "type": "git",