@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.mjs CHANGED
@@ -681,7 +681,7 @@ var Call = class {
681
681
  // package.json
682
682
  var package_default = {
683
683
  name: "@koi-design/callkit",
684
- version: "2.1.0-beta.8",
684
+ version: "2.1.2",
685
685
  description: "callkit",
686
686
  author: "koi",
687
687
  license: "ISC",
@@ -2238,6 +2238,9 @@ var Socket = class {
2238
2238
  get reconnectConfig() {
2239
2239
  return this.callKit.config.getReconnectConfig("incall");
2240
2240
  }
2241
+ isConnected() {
2242
+ return this.connectAuthState.isConnected;
2243
+ }
2241
2244
  init() {
2242
2245
  const { socket } = this.callKit.config.getConfig();
2243
2246
  this.callKit.logger.info(`socket init: ${socket}`, {
@@ -2569,16 +2572,12 @@ var Socket = class {
2569
2572
  const now = Date.now();
2570
2573
  const { pingInterval, pingTimeout } = this.reconnectConfig;
2571
2574
  if (now - this.lastPingTime > pingInterval + pingTimeout) {
2572
- if (this.ws && this.connectAuthState.isConnected) {
2573
- this.ws.close(4001, "ping timeout");
2574
- } else {
2575
- this.callKit.reset();
2576
- }
2577
- this.callKit.logger.error("socket ping timeout", {
2575
+ this.callKit.logger.warn("Ping timeout not connected", {
2578
2576
  caller: "Socket.ping",
2579
2577
  type: "INCALL",
2580
2578
  content: {
2581
- errCode: ErrorCode.SOCKET_PING_TIMEOUT
2579
+ errCode: ErrorCode.SOCKET_PING_TIMEOUT,
2580
+ isConnected: this.isConnected()
2582
2581
  }
2583
2582
  });
2584
2583
  this.callKit.trigger(KitEvent.INCALL_CONNECT_EVENT, {