@7365admin1/core 3.99.1-staging.411 → 3.99.1-staging.412

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.
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@7365admin1/core": patch
3
+ ---
4
+
5
+ Camera fault notifications: the inbox (bell, unread badge, phone feed) now gets one "Camera fault" row per outage instead of one for every paced toast. A flapping ANPR camera had left two identical rows 30 seconds apart for every drop, filling 156 of a property manager's 200 newest notifications. The live toast pacing is unchanged. Dashboard "Needs Attention" lines now read "waiting to be acknowledged" / "waiting for approval".
package/dist/index.js CHANGED
@@ -23005,6 +23005,9 @@ function shouldAlertOnFailure(consecutiveFailures) {
23005
23005
  return false;
23006
23006
  return (consecutiveFailures - CAMERA_ALERT_EVERY_AFTER) % CAMERA_ALERT_EVERY_AFTER === 0;
23007
23007
  }
23008
+ function shouldStoreCameraFault(alertedThisOutage) {
23009
+ return alertedThisOutage === 0;
23010
+ }
23008
23011
 
23009
23012
  // src/utils/dahua-protocol.util.ts
23010
23013
  var DAHUA_AUTH_ATTEMPTS_BEFORE_ALERT = 2;
@@ -24172,6 +24175,7 @@ function useDahuaService() {
24172
24175
  `[${camera?.siteName}-${camera?.direction}] Connection lost or error: ${error.message || error}. Retrying in 10 seconds... (failure ${connectionFailureCount})`
24173
24176
  );
24174
24177
  if (onDetected && shouldAlertOnFailure(connectionFailureCount)) {
24178
+ const storeInInbox = shouldStoreCameraFault(alertedFailureCount);
24175
24179
  alertedFailureCount = connectionFailureCount;
24176
24180
  onDetected({
24177
24181
  site: camera?.site,
@@ -24180,7 +24184,8 @@ function useDahuaService() {
24180
24184
  camera: camera?._id?.toString(),
24181
24185
  message: cameraUnreachableMessage(camera)
24182
24186
  });
24183
- notifyCameraFault(camera, cameraUnreachableMessage(camera));
24187
+ if (storeInInbox)
24188
+ notifyCameraFault(camera, cameraUnreachableMessage(camera));
24184
24189
  }
24185
24190
  }
24186
24191
  } finally {
@@ -92430,7 +92435,7 @@ function useNewDashboardRepo() {
92430
92435
  todayAttentions.push({
92431
92436
  id: pendingIncidentDocs[0]._id.toString(),
92432
92437
  type: "incident",
92433
- title: `${pendingIncidentCount} incident${pendingIncidentCount === 1 ? "" : "s"} pending acknowledge`,
92438
+ title: `${pendingIncidentCount} incident${pendingIncidentCount === 1 ? "" : "s"} waiting to be acknowledged`,
92434
92439
  createdAt: pendingIncidentDocs[0].updatedAt || pendingIncidentDocs[0].createdAt || /* @__PURE__ */ new Date()
92435
92440
  });
92436
92441
  }
@@ -92438,7 +92443,7 @@ function useNewDashboardRepo() {
92438
92443
  todayAttentions.push({
92439
92444
  id: pendingFacilityBookingDocs[0]._id.toString(),
92440
92445
  type: "facility-booking",
92441
- title: `${pendingFacilityBookingCount} facility booking${pendingFacilityBookingCount === 1 ? "" : "s"} need approval`,
92446
+ title: `${pendingFacilityBookingCount} facility booking${pendingFacilityBookingCount === 1 ? "" : "s"} waiting for approval`,
92442
92447
  createdAt: pendingFacilityBookingDocs[0].createdAt || /* @__PURE__ */ new Date()
92443
92448
  });
92444
92449
  }