fix(desktop): actually close relay sockets — plugin:websocket|disconnect does not exist (#1481)

Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
This commit is contained in:
Wes
2026-07-02 16:55:53 -06:00
committed by GitHub
parent 3e282a2418
commit e70dd1a1e7
6 changed files with 117 additions and 22 deletions

View File

@@ -7,6 +7,7 @@ import {
sortEvents,
type RelaySubscriptionFilter,
} from "@/shared/api/relayClientShared";
import { closeWebSocket } from "@/shared/api/relayWebSocketClose";
const AUTH_TIMEOUT_MS = 8_000;
const HISTORY_TIMEOUT_MS = 8_000;
@@ -62,9 +63,7 @@ export class ReadOnlyRelayClient {
this.generation++;
if (this.wsId !== null) {
void invoke("plugin:websocket|disconnect", { id: this.wsId }).catch(
() => {},
);
void closeWebSocket(this.wsId, "observer disconnected");
this.wsId = null;
}