@koi-design/callkit 2.1.0-beta.9 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -96,6 +96,7 @@ declare class Socket {
96
96
  pingTimeout?: number;
97
97
  excludeLogEvents?: string[];
98
98
  };
99
+ isConnected(): boolean;
99
100
  init(): void;
100
101
  private setConnectAuthState;
101
102
  private handleDisconnect;
@@ -3879,7 +3879,7 @@ var WebCall = (() => {
3879
3879
  // package.json
3880
3880
  var package_default = {
3881
3881
  name: "@koi-design/callkit",
3882
- version: "2.1.0-beta.8",
3882
+ version: "2.1.2",
3883
3883
  description: "callkit",
3884
3884
  author: "koi",
3885
3885
  license: "ISC",
@@ -19828,6 +19828,9 @@ ${log}` : log;
19828
19828
  get reconnectConfig() {
19829
19829
  return this.callKit.config.getReconnectConfig("incall");
19830
19830
  }
19831
+ isConnected() {
19832
+ return this.connectAuthState.isConnected;
19833
+ }
19831
19834
  init() {
19832
19835
  const { socket } = this.callKit.config.getConfig();
19833
19836
  this.callKit.logger.info(`socket init: ${socket}`, {
@@ -20159,16 +20162,12 @@ ${log}` : log;
20159
20162
  const now = Date.now();
20160
20163
  const { pingInterval, pingTimeout } = this.reconnectConfig;
20161
20164
  if (now - this.lastPingTime > pingInterval + pingTimeout) {
20162
- if (this.ws && this.connectAuthState.isConnected) {
20163
- this.ws.close(4001, "ping timeout");
20164
- } else {
20165
- this.callKit.reset();
20166
- }
20167
- this.callKit.logger.error("socket ping timeout", {
20165
+ this.callKit.logger.warn("Ping timeout not connected", {
20168
20166
  caller: "Socket.ping",
20169
20167
  type: "INCALL",
20170
20168
  content: {
20171
- errCode: ErrorCode.SOCKET_PING_TIMEOUT
20169
+ errCode: ErrorCode.SOCKET_PING_TIMEOUT,
20170
+ isConnected: this.isConnected()
20172
20171
  }
20173
20172
  });
20174
20173
  this.callKit.trigger(KitEvent.INCALL_CONNECT_EVENT, {