fix(occupancy): orphan camera code — group code written as a fake camera when a group has no exit camera #51
Labels
No labels
blocked
bug
enhancement
high-priority
low-priority
needs-info
needs-triage
ready-for-agent
ready-for-human
referenced
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gabogg/hikcentral#51
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
When a resource group has no exit-typed camera, the sync falls back to writing counting events keyed by the resource-group code as if it were a camera:
Those events land in the per-camera counting table with
camera_index_code = <resource group code>— an orphan camera code that matches no real camera. It pollutes portal/zone attribution and any per-camera roll-up with a phantom "camera" that is actually a group.This was referenced as "the separate orphan-camera-code issue" in #28 but had never been filed.
Dependency
Blocked by #28. #28 makes
counting_cameras.direction_typeauthoritative and rewrites thein_cams/out_camsderivation, and adds the guard that stops new orphan rows being written. This issue must land after #28 — it owns the cleanup of existing orphan rows and the assertion that no group code is ever written as a camera code. Starting before #28 would rework the same lines twice.Suggested fix (after #28)
counting_events/ per-camera rows whosecamera_index_codeequals a known resource-group code, and either re-attribute to the group level or quarantine them.camera_index_codein the counting table must resolve to a row incounting_cameras.Acceptance criteria
camera_index_codeequal to a resource-group code.camera_index_codein the counting table resolves to acounting_camerasrow.Surfaced during the grilling session on #28.
Closing as a duplicate of #29, which is older and describes the same orphan resource-group-code bug more completely (invisible rows + 3 s re-injection). The fix is folded into PR #53 (Closes #29). Kept the dependency reasoning there.