@riddix/hamh 2.1.0-alpha.567 → 2.1.0-alpha.568

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.
@@ -181186,11 +181186,11 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
181186
181186
  * Writing directly via endpoint.act() creates an independent
181187
181187
  * transaction that goes through the full commit lifecycle. */
181188
181188
  keepaliveTimer;
181189
- /** Alternating nonce so operationalError is structurally different
181190
- * each keepalive tick. matter.js's Datasource uses isDeepEqual;
181191
- * toggling errorStateDetails between absent and "" changes the
181192
- * property count so the struct is never deep-equal. */
181193
- keepaliveNonce = false;
181189
+ /** Monotonic counter that ensures operationalError is structurally
181190
+ * different on every keepalive tick. matter.js's Datasource uses
181191
+ * isDeepEqual; a unique errorStateLabel value guarantees the struct
181192
+ * is never deep-equal to its predecessor. */
181193
+ keepaliveCounter = 0;
181194
181194
  constructor(type, entityId, customName, mappedEntityIds) {
181195
181195
  super(type, entityId, customName, mappedEntityIds);
181196
181196
  this.flushUpdate = debounce6(this.flushPendingUpdate.bind(this), 50);
@@ -181210,22 +181210,24 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
181210
181210
  }
181211
181211
  /**
181212
181212
  * Write directly to the RvcOperationalState cluster in a fresh
181213
- * transaction. The nonce toggles errorStateDetails between absent
181214
- * and "" so the struct is structurally different each call,
181213
+ * transaction. Each call produces a unique errorStateLabel value
181214
+ * so the struct is never deep-equal to its predecessor,
181215
181215
  * guaranteeing matter.js emits attrsChanged → subscription report.
181216
181216
  */
181217
181217
  async pushKeepalive() {
181218
181218
  try {
181219
+ this.keepaliveCounter++;
181220
+ const counter = this.keepaliveCounter;
181221
+ logger203.info(`Keepalive #${counter} for ${this.entityId}`);
181219
181222
  await this.act("vacuum-keepalive", async (agent) => {
181220
181223
  const opState = agent.get(RvcOperationalStateServer);
181221
- this.keepaliveNonce = !this.keepaliveNonce;
181222
181224
  const errorStateId = opState.state.operationalError.errorStateId;
181223
- const operationalError = { errorStateId };
181224
- if (this.keepaliveNonce) {
181225
- operationalError.errorStateDetails = "";
181226
- }
181227
- opState.state.operationalError = operationalError;
181225
+ opState.state.operationalError = {
181226
+ errorStateId,
181227
+ errorStateLabel: `k${counter}`
181228
+ };
181228
181229
  });
181230
+ logger203.info(`Keepalive #${counter} committed for ${this.entityId}`);
181229
181231
  } catch (e) {
181230
181232
  if (e instanceof TransactionDestroyedError || e instanceof DestroyedDependencyError) {
181231
181233
  return;
@@ -181234,7 +181236,7 @@ var ServerModeVacuumEndpoint = class _ServerModeVacuumEndpoint extends EntityEnd
181234
181236
  if (msg.includes("Endpoint storage inaccessible")) {
181235
181237
  return;
181236
181238
  }
181237
- logger203.debug(`Keepalive failed for ${this.entityId}: ${msg}`);
181239
+ logger203.warn(`Keepalive failed for ${this.entityId}: ${msg}`);
181238
181240
  }
181239
181241
  }
181240
181242
  async updateStates(states) {