mqtt 5.8.0 → 5.8.1

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/mqtt.js CHANGED
@@ -12634,7 +12634,7 @@ var mqtt = (() => {
12634
12634
  // package-json:../../package.json
12635
12635
  var require_package = __commonJS({
12636
12636
  "package-json:../../package.json"(exports5, module) {
12637
- module.exports = { version: "5.8.0" };
12637
+ module.exports = { version: "5.8.1" };
12638
12638
  }
12639
12639
  });
12640
12640
 
@@ -17223,7 +17223,7 @@ var mqtt = (() => {
17223
17223
  break;
17224
17224
  case "pingresp":
17225
17225
  client.log("_handlePacket :: received pingresp");
17226
- client.reschedulePing();
17226
+ client.reschedulePing(true);
17227
17227
  done();
17228
17228
  break;
17229
17229
  case "disconnect":
@@ -17913,6 +17913,12 @@ var mqtt = (() => {
17913
17913
  const packets = [];
17914
17914
  this.log("connect :: calling method to clear reconnect");
17915
17915
  this._clearReconnect();
17916
+ if (this.disconnected && !this.reconnecting) {
17917
+ this.incomingStore = this.options.incomingStore || new store_1.default();
17918
+ this.outgoingStore = this.options.outgoingStore || new store_1.default();
17919
+ this.disconnecting = false;
17920
+ this.disconnected = false;
17921
+ }
17916
17922
  this.log("connect :: using streamBuilder provided to client to create stream");
17917
17923
  this.stream = this.streamBuilder(this);
17918
17924
  parser.on("packet", (packet) => {
@@ -18323,6 +18329,8 @@ var mqtt = (() => {
18323
18329
  });
18324
18330
  if (this._deferredReconnect) {
18325
18331
  this._deferredReconnect();
18332
+ } else if (this.options.reconnectPeriod === 0 || this.options.manualConnect) {
18333
+ this.disconnecting = false;
18326
18334
  }
18327
18335
  };
18328
18336
  const finish = () => {
@@ -18684,8 +18692,8 @@ var mqtt = (() => {
18684
18692
  this.keepaliveManager = null;
18685
18693
  }
18686
18694
  }
18687
- reschedulePing() {
18688
- if (this.keepaliveManager && this.options.keepalive && this.options.reschedulePings) {
18695
+ reschedulePing(force = false) {
18696
+ if (this.keepaliveManager && this.options.keepalive && (force || this.options.reschedulePings)) {
18689
18697
  this._reschedulePing();
18690
18698
  }
18691
18699
  }