Skip to content

Commit f15c41b

Browse files
committed
fix(lazer-sdk-js): swapped to the correct WS closing function and removed an unnecessary isBrowser conditional check
1 parent 6e91b89 commit f15c41b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lazer/sdk/js/src/socket/resilient-websocket.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export class ResilientWebSocket {
155155

156156
this.heartbeatTimeout = setTimeout(() => {
157157
this.logger.warn("Connection timed out. Reconnecting...");
158-
this.wsClient?.terminate();
158+
this.wsClient?.close();
159159
this.handleReconnect();
160160
}, this.heartbeatTimeoutDurationMs);
161161
}
@@ -184,8 +184,8 @@ export class ResilientWebSocket {
184184
if (this.shouldLogRetry()) {
185185
this.logger.error(
186186
"Connection closed unexpectedly or because of timeout. Reconnecting after " +
187-
String(this.retryDelayMs()) +
188-
"ms.",
187+
String(this.retryDelayMs()) +
188+
"ms.",
189189
);
190190
}
191191

lazer/sdk/js/src/util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export function envIsWorker() {
2323
export function envIsBrowser() {
2424
// disabling this rule for this line, as the rule is reporting a false positive (it's a bug)
2525
// for the typeof check for the existence of the querySelector function
26-
// eslint-disable-next-line @typescript-eslint/no-deprecated
27-
return typeof window !== 'undefined' && Boolean(window.navigator.userAgent) && typeof window.document.querySelector === 'function';
26+
27+
return typeof window !== 'undefined' && Boolean(window.navigator.userAgent);
2828
}
2929

3030
/**

0 commit comments

Comments
 (0)