@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.
- package/.changeset/camera-fault-inbox-once.md +5 -0
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -3
- package/dist/index.mjs.map +1 -1
- package/logs/.6b77785a74c362881f6fb7e95a7530280abbf9ed-audit.json +5 -5
- package/logs/.ca6dad43b7d35307d69543a741eb24d3ce997028-audit.json +5 -5
- package/logs/dahua/.6ec119960df5f4d6b0eca28515ba03f28bca7d1b-audit.json +5 -0
- package/logs/dahua/.ddefed381272b698d725b4376425900c8428d7a4-audit.json +5 -0
- package/package.json +1 -1
- package/test/camera-alert.util.test.mjs +20 -0
- package/logs/combined-2026-09-10.log +0 -0
- package/logs/error-2026-09-10.log +0 -0
|
@@ -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
|
-
|
|
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"}
|
|
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"}
|
|
92446
|
+
title: `${pendingFacilityBookingCount} facility booking${pendingFacilityBookingCount === 1 ? "" : "s"} waiting for approval`,
|
|
92442
92447
|
createdAt: pendingFacilityBookingDocs[0].createdAt || /* @__PURE__ */ new Date()
|
|
92443
92448
|
});
|
|
92444
92449
|
}
|