Guard lookups when adding/deleting cameras at runtime (#23994)

* Guard object processor queue handlers against unknown cameras

* Skip embeddings post processing for removed cameras

* End review segments for removed cameras

* Drop queued autotracker moves for removed cameras

* Release tracked event thumbnails when skipping a removed camera

* Add locked accessors for camera states

* Read camera states through the processor accessors

* Guard output and recording paths against cameras not yet known

* Resolve camera state once in ONVIF, notification, and transcription paths
This commit is contained in:
Josh Hawkins
2026-09-12 07:30:04 -06:00
committed by Nicolas Mowen
parent d6a18e79aa
commit d78f6a7a98
16 changed files with 463 additions and 128 deletions
+12 -7
View File
@@ -220,7 +220,9 @@ class WebPushClient(Communicator):
if topic == "reviews":
decoded = json.loads(payload)
camera = decoded["before"]["camera"]
if not self.config.cameras[camera].notifications.enabled:
camera_config = self.config.cameras.get(camera)
if camera_config is None or not camera_config.notifications.enabled:
return
if self.is_camera_suspended(camera):
logger.debug(f"Notifications for {camera} are currently suspended.")
@@ -234,13 +236,14 @@ class WebPushClient(Communicator):
# ensure notifications are enabled and the specific trigger has
# notification action enabled
camera_config = self.config.cameras.get(camera)
if (
not self.config.cameras[camera].notifications.enabled
or name not in self.config.cameras[camera].semantic_search.triggers
camera_config is None
or not camera_config.notifications.enabled
or name not in camera_config.semantic_search.triggers
or "notification"
not in self.config.cameras[camera]
.semantic_search.triggers[name]
.actions
not in camera_config.semantic_search.triggers[name].actions
):
return
@@ -251,7 +254,9 @@ class WebPushClient(Communicator):
elif topic == "camera_monitoring":
decoded = json.loads(payload)
camera = decoded["camera"]
if not self.config.cameras[camera].notifications.enabled:
camera_config = self.config.cameras.get(camera)
if camera_config is None or not camera_config.notifications.enabled:
return
if self.is_camera_suspended(camera):
logger.debug(f"Notifications for {camera} are currently suspended.")