@riddix/hamh 2.1.0-alpha.546 → 2.1.0-alpha.548

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.
@@ -175737,24 +175737,27 @@ var RvcRunModeServerBase = class extends RvcRunModeServer {
175737
175737
  }
175738
175738
  /**
175739
175739
  * Update progress entries to reflect the current operating area.
175740
- * - null: mark all Operating/Pending entries as Completed (cleaning done)
175741
- * - areaId: mark that area as Operating
175740
+ * - null: mark all areas as Completed (cleaning done)
175741
+ * - areaId: mark that area as Operating, others as Pending
175742
175742
  *
175743
- * Note: progress is available because our ServiceAreaServerBase enables
175744
- * ProgressReporting, but the base ServiceAreaBehavior type doesn't expose it.
175743
+ * Rebuilds progress from selectedAreas (plain number array) instead of
175744
+ * reading managed state progress entries, which avoids infinite recursion
175745
+ * in matter.js property getters during transaction pre-commit.
175745
175746
  */
175746
175747
  updateProgress(serviceArea, areaId) {
175747
175748
  const state = serviceArea.state;
175748
- const progress = state.progress;
175749
- if (!progress || progress.length === 0) return;
175749
+ const selectedAreas = serviceArea.state.selectedAreas;
175750
+ if (!selectedAreas || selectedAreas.length === 0) return;
175750
175751
  if (areaId === null) {
175751
- state.progress = progress.map(
175752
- (p) => p.status === ServiceArea3.OperationalStatus.Operating || p.status === ServiceArea3.OperationalStatus.Pending ? { ...p, status: ServiceArea3.OperationalStatus.Completed } : p
175753
- );
175752
+ state.progress = selectedAreas.map((id) => ({
175753
+ areaId: id,
175754
+ status: ServiceArea3.OperationalStatus.Completed
175755
+ }));
175754
175756
  } else {
175755
- state.progress = progress.map(
175756
- (p) => p.areaId === areaId && p.status === ServiceArea3.OperationalStatus.Pending ? { ...p, status: ServiceArea3.OperationalStatus.Operating } : p
175757
- );
175757
+ state.progress = selectedAreas.map((id) => ({
175758
+ areaId: id,
175759
+ status: id === areaId ? ServiceArea3.OperationalStatus.Operating : ServiceArea3.OperationalStatus.Pending
175760
+ }));
175758
175761
  }
175759
175762
  }
175760
175763
  /**