From dfc6ff9202104d710aba4803b742c6da19a49df0 Mon Sep 17 00:00:00 2001 From: ryzendigo <48058157+ryzendigo@users.noreply.github.com> Date: Mon, 16 Mar 2026 20:43:25 +0800 Subject: [PATCH] fix: variable shadowing silently drops object label updates (#22472) When an existing tracked object's label or stationary status changes (e.g. sub_label assignment from face recognition), the update handler declares a new const newObjects that shadows the outer let newObjects. The label and stationary mutations apply to the inner copy, but handleSetObjects on line 148 reads the outer variable which was never mutated. The update is silently discarded. Remove the inner declaration so mutations apply to the outer variable that gets passed to handleSetObjects. --- web/src/hooks/use-camera-activity.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/web/src/hooks/use-camera-activity.ts b/web/src/hooks/use-camera-activity.ts index 71507c2af..76a982725 100644 --- a/web/src/hooks/use-camera-activity.ts +++ b/web/src/hooks/use-camera-activity.ts @@ -125,8 +125,6 @@ export function useCameraActivity( newObjects = [...(objects ?? []), newActiveObject]; } } else { - const newObjects = [...(objects ?? [])]; - let label = updatedEvent.after.label; if (updatedEvent.after.sub_label) {