polfan-server-js-client 0.2.69 → 0.2.71

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.
@@ -164,7 +164,7 @@
164
164
  <workItem from="1764794428269" duration="595000" />
165
165
  <workItem from="1764847260499" duration="28335000" />
166
166
  <workItem from="1765180748047" duration="596000" />
167
- <workItem from="1765272289918" duration="2519000" />
167
+ <workItem from="1765272289918" duration="3221000" />
168
168
  </task>
169
169
  <task id="LOCAL-00020" summary="UsersManager">
170
170
  <option name="closed" value="true" />
@@ -4280,9 +4280,9 @@ var WebSocketChatClient = /*#__PURE__*/function (_AbstractChatClient) {
4280
4280
  WebSocketChatClient_defineProperty(_this, "connectingTimeoutId", void 0);
4281
4281
  WebSocketChatClient_defineProperty(_this, "authenticated", void 0);
4282
4282
  WebSocketChatClient_defineProperty(_this, "authenticatedResolvers", void 0);
4283
- WebSocketChatClient_defineProperty(_this, "pingIntervalId", void 0);
4283
+ WebSocketChatClient_defineProperty(_this, "pingMonitorInterval", void 0);
4284
+ WebSocketChatClient_defineProperty(_this, "inFlightPingTimeout", void 0);
4284
4285
  WebSocketChatClient_defineProperty(_this, "lastReceivedMessageAt", void 0);
4285
- WebSocketChatClient_defineProperty(_this, "pingInFlight", void 0);
4286
4286
  _this.options = options;
4287
4287
  if ((_this$options$stateTr = _this.options.stateTracking) !== null && _this$options$stateTr !== void 0 ? _this$options$stateTr : true) {
4288
4288
  _this.state = new ChatStateTracker(_this);
@@ -4466,12 +4466,11 @@ var WebSocketChatClient = /*#__PURE__*/function (_AbstractChatClient) {
4466
4466
  return;
4467
4467
  }
4468
4468
  this.lastReceivedMessageAt = Date.now();
4469
- this.pingIntervalId = setInterval(/*#__PURE__*/WebSocketChatClient_asyncToGenerator(/*#__PURE__*/WebSocketChatClient_regenerator().m(function _callee3() {
4470
- var timeout;
4469
+ this.pingMonitorInterval = setInterval(/*#__PURE__*/WebSocketChatClient_asyncToGenerator(/*#__PURE__*/WebSocketChatClient_regenerator().m(function _callee3() {
4471
4470
  return WebSocketChatClient_regenerator().w(function (_context3) {
4472
4471
  while (1) switch (_context3.n) {
4473
4472
  case 0:
4474
- if (!(!_this4.isReady || _this4.pingInFlight)) {
4473
+ if (!(!_this4.isReady || _this4.inFlightPingTimeout)) {
4475
4474
  _context3.n = 1;
4476
4475
  break;
4477
4476
  }
@@ -4483,14 +4482,13 @@ var WebSocketChatClient = /*#__PURE__*/function (_AbstractChatClient) {
4483
4482
  }
4484
4483
  return _context3.a(2);
4485
4484
  case 2:
4486
- timeout = setTimeout(function () {
4487
- _this4.pingInFlight = false;
4488
- _this4.ws.close(1008); // Service Restart (reconnect)
4485
+ _this4.inFlightPingTimeout = setTimeout(function () {
4486
+ _this4.inFlightPingTimeout = undefined;
4487
+ _this4.ws.close(3000); // Service Restart (reconnect)
4489
4488
  }, _this4.options.ping.pongBackTimeoutMs);
4490
- _this4.pingInFlight = true;
4491
4489
  _this4.send('Ping', {}).then(function () {
4492
- _this4.pingInFlight = false;
4493
- clearTimeout(timeout);
4490
+ _this4.inFlightPingTimeout = undefined;
4491
+ clearTimeout(_this4.inFlightPingTimeout);
4494
4492
  });
4495
4493
  case 3:
4496
4494
  return _context3.a(2);
@@ -4501,11 +4499,14 @@ var WebSocketChatClient = /*#__PURE__*/function (_AbstractChatClient) {
4501
4499
  }, {
4502
4500
  key: "stopConnectionMonitor",
4503
4501
  value: function stopConnectionMonitor() {
4504
- if (this.pingIntervalId) {
4505
- clearInterval(this.pingIntervalId);
4506
- this.pingIntervalId = undefined;
4502
+ if (this.inFlightPingTimeout) {
4503
+ clearTimeout(this.inFlightPingTimeout);
4504
+ this.inFlightPingTimeout = undefined;
4505
+ }
4506
+ if (this.pingMonitorInterval) {
4507
+ clearInterval(this.pingMonitorInterval);
4508
+ this.pingMonitorInterval = undefined;
4507
4509
  }
4508
- this.pingInFlight = false;
4509
4510
  }
4510
4511
  }]);
4511
4512
  }(AbstractChatClient);