@mega-yfue/eufy-sdk 0.5.0-beta.86 → 0.5.0-beta.87

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.js CHANGED
@@ -27402,6 +27402,11 @@ var PushClient = class _PushClient extends EventEmitter13 {
27402
27402
  closing = false;
27403
27403
  /** Consecutive MCS login rejections — transient ones self-heal via reconnect (see {@link onMessage}). */
27404
27404
  loginFailures = 0;
27405
+ /**
27406
+ * How many of {@link persistentIds} the last `LoginRequest` reported; a successful `LoginResponse`
27407
+ * acknowledges them, so they are dropped then.
27408
+ */
27409
+ reportedIds = 0;
27405
27410
  constructor(creds, logger = noopLogger) {
27406
27411
  super();
27407
27412
  this.creds = creds;
@@ -27460,6 +27465,7 @@ var PushClient = class _PushClient extends EventEmitter13 {
27460
27465
  clientEvent: [],
27461
27466
  receivedPersistentId: this.persistentIds
27462
27467
  };
27468
+ this.reportedIds = this.persistentIds.length;
27463
27469
  const buf = LoginRequest.encodeDelimited(obj).finish();
27464
27470
  return Buffer.concat([Buffer.from([MCS_VERSION, MessageTag.LoginRequest]), buf]);
27465
27471
  }
@@ -27483,6 +27489,8 @@ var PushClient = class _PushClient extends EventEmitter13 {
27483
27489
  this.loggedIn = true;
27484
27490
  this.currentDelay = 0;
27485
27491
  this.loginFailures = 0;
27492
+ this.persistentIds = this.persistentIds.slice(this.reportedIds);
27493
+ this.reportedIds = 0;
27486
27494
  this.startHeartbeat();
27487
27495
  this.logger.debug("[push] logged in");
27488
27496
  this.emit("connect");