polfan-server-js-client 0.2.68 → 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.
@@ -4,7 +4,12 @@
4
4
  <option name="autoReloadType" value="SELECTIVE" />
5
5
  </component>
6
6
  <component name="ChangeListManager">
7
- <list default="true" id="831dae43-0da1-47fd-a5f7-33dd5eec2992" name="Changes" comment="Ping-pong connection monitoring">
7
+ <list default="true" id="831dae43-0da1-47fd-a5f7-33dd5eec2992" name="Changes" comment="Improve reconnect on timeout">
8
+ <change beforePath="$PROJECT_DIR$/build/index.cjs.js" beforeDir="false" afterPath="$PROJECT_DIR$/build/index.cjs.js" afterDir="false" />
9
+ <change beforePath="$PROJECT_DIR$/build/index.cjs.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/build/index.cjs.js.map" afterDir="false" />
10
+ <change beforePath="$PROJECT_DIR$/build/index.umd.js" beforeDir="false" afterPath="$PROJECT_DIR$/build/index.umd.js" afterDir="false" />
11
+ <change beforePath="$PROJECT_DIR$/build/index.umd.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/build/index.umd.js.map" afterDir="false" />
12
+ <change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
8
13
  <change beforePath="$PROJECT_DIR$/src/WebSocketChatClient.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/WebSocketChatClient.ts" afterDir="false" />
9
14
  </list>
10
15
  <option name="SHOW_DIALOG" value="false" />
@@ -157,15 +162,9 @@
157
162
  <workItem from="1764758258935" duration="1127000" />
158
163
  <workItem from="1764792690210" duration="1002000" />
159
164
  <workItem from="1764794428269" duration="595000" />
160
- <workItem from="1764847260499" duration="26458000" />
161
- </task>
162
- <task id="LOCAL-00019" summary="Add notify option to Kick command">
163
- <option name="closed" value="true" />
164
- <created>1740515104457</created>
165
- <option name="number" value="00019" />
166
- <option name="presentableId" value="LOCAL-00019" />
167
- <option name="project" value="LOCAL" />
168
- <updated>1740515104457</updated>
165
+ <workItem from="1764847260499" duration="28335000" />
166
+ <workItem from="1765180748047" duration="596000" />
167
+ <workItem from="1765272289918" duration="3221000" />
169
168
  </task>
170
169
  <task id="LOCAL-00020" summary="UsersManager">
171
170
  <option name="closed" value="true" />
@@ -551,7 +550,15 @@
551
550
  <option name="project" value="LOCAL" />
552
551
  <updated>1765145134871</updated>
553
552
  </task>
554
- <option name="localTasksCounter" value="68" />
553
+ <task id="LOCAL-00068" summary="Improve reconnect on timeout">
554
+ <option name="closed" value="true" />
555
+ <created>1765145773196</created>
556
+ <option name="number" value="00068" />
557
+ <option name="presentableId" value="LOCAL-00068" />
558
+ <option name="project" value="LOCAL" />
559
+ <updated>1765145773196</updated>
560
+ </task>
561
+ <option name="localTasksCounter" value="69" />
555
562
  <servers />
556
563
  </component>
557
564
  <component name="TypeScriptGeneratedFilesManager">
@@ -569,7 +576,6 @@
569
576
  </option>
570
577
  </component>
571
578
  <component name="VcsManagerConfiguration">
572
- <MESSAGE value="New message type" />
573
579
  <MESSAGE value="Dedicated event for user status change" />
574
580
  <MESSAGE value="Fix update the latest message in a room default topic" />
575
581
  <MESSAGE value="Adapt FilesClient to new files API" />
@@ -594,7 +600,8 @@
594
600
  <MESSAGE value="Align to custom colors and nicks protocol changes" />
595
601
  <MESSAGE value="Connection handling optimizations" />
596
602
  <MESSAGE value="Ping-pong connection monitoring" />
597
- <option name="LAST_COMMIT_MESSAGE" value="Ping-pong connection monitoring" />
603
+ <MESSAGE value="Improve reconnect on timeout" />
604
+ <option name="LAST_COMMIT_MESSAGE" value="Improve reconnect on timeout" />
598
605
  </component>
599
606
  <component name="github-copilot-workspace">
600
607
  <instructionFileLocations>
@@ -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(1012); // 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);