mirror of
https://github.com/block/buzz.git
synced 2026-12-01 13:42:45 +00:00
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:
@@ -34,6 +34,7 @@ import {
|
||||
shouldScheduleReconnect,
|
||||
} from "@/shared/api/relayReconnectPolicy";
|
||||
import { RelayStallWatchdog } from "@/shared/api/relayStallWatchdog";
|
||||
import { closeWebSocket } from "@/shared/api/relayWebSocketClose";
|
||||
import { buildThreadReferenceTags } from "@/features/messages/lib/threading";
|
||||
|
||||
const RECONNECT_BASE_DELAY_MS = 1_000,
|
||||
@@ -114,9 +115,7 @@ export class RelayClient {
|
||||
this.connectionStateEmitter.set("idle");
|
||||
|
||||
if (this.wsId !== null) {
|
||||
void invoke("plugin:websocket|disconnect", { id: this.wsId }).catch(
|
||||
() => {},
|
||||
);
|
||||
void closeWebSocket(this.wsId, "workspace switch");
|
||||
this.wsId = null;
|
||||
}
|
||||
|
||||
@@ -981,11 +980,7 @@ export class RelayClient {
|
||||
}
|
||||
|
||||
if (this.wsId !== null) {
|
||||
void invoke("plugin:websocket|disconnect", { id: this.wsId }).catch(
|
||||
(err) => {
|
||||
console.warn("[RelayClientSession] disconnect failed:", err);
|
||||
},
|
||||
);
|
||||
void closeWebSocket(this.wsId, "connection reset");
|
||||
}
|
||||
|
||||
this.wsId = null;
|
||||
|
||||
Reference in New Issue
Block a user