autoLive ?? globalAutoLive can be undefined when useUserPersistence
hasn't hydrated yet. Change the prop type to optional boolean and
treat undefined as the default-true value (show dot unless explicitly
set to false via no-streaming mode).
https://claude.ai/code/session_019B4dJXtcxvHn97ZaqHUB62
The previous approach (useEffect → onActiveMotionChange callback →
parent state update) was unreliable: the dot only appeared if motion
was active at the moment of initial mount but did not react to
subsequent WS motion events.
Root cause: the intermediate state chain breaks because React's
useEffect batching and component re-render timing can cause the
parent state to lag behind or miss updates when motion changes after
mount.
Fix: replace the mechanism entirely with a dedicated CameraMotionDot
component that calls useCameraActivity directly. Being a proper React
component it subscribes to the {camera}/motion WS topic via
useSyncExternalStore and re-renders immediately and reliably whenever
motion state changes — no intermediate callbacks or parent state needed.
- Remove onActiveMotionChange prop from LivePlayer; add showMotionDot
boolean prop (default true) to suppress the internal dot in grid view
- Remove cameraMotionStates state and setCameraMotionStates from
DraggableGridLayout
- Add CameraMotionDot component with direct useCameraActivity hook
https://claude.ai/code/session_019B4dJXtcxvHn97ZaqHUB62
* fix: check HTTP response status before parsing JSON body
upload_image() calls r.json() before checking r.ok. If the server
returns an error response (401, 500, etc) with a non-JSON body,
this raises a confusing JSONDecodeError instead of the intended
'Unable to get signed urls' error message.
Move the r.ok check before the r.json() call.
* style: remove extra blank line for ruff
The name parameter was interpolated directly into the SQL query via
f-string, allowing SQL injection through crafted face name values.
Use a parameterized query with ? placeholder instead.
parse_preset_input() uses input[len(_user_agent_args) + 1] to find
the FPS placeholder, but preset-http-jpeg-generic does not include
_user_agent_args at the start of its list (only preset-http-mjpeg-generic
does). The FPS placeholder '{}' is at index 1, not index 3.
This means the detect_fps value overwrites '-1' (the stream_loop
argument) instead of the '{}' FPS placeholder, so the preset always
uses the literal string '{}' as the framerate.
When hwaccel_args is a list (not a preset string), the fallback in
parse_preset_hardware_acceleration_encode() calls
arg_map["default"].format(input, output) with only 2 positional args.
But PRESETS_HW_ACCEL_ENCODE_BIRDSEYE["default"] contains {0}, {1}, {2}
expecting ffmpeg_path as the first arg.
This causes IndexError: Replacement index 2 out of range for size 2
which crashes create_config.py on every go2rtc start, taking down
all camera streams.
Pass ffmpeg_path as the first argument to match the preset template.
In BirdsEyeFrameManager.__init__(), the numpy slice that copies the
custom logo (transparent_layer from custom.png alpha channel) onto
blank_frame has shape[0] and shape[1] swapped:
blank_frame[y:y+shape[1], x:x+shape[0]] = transparent_layer
shape[0] is rows (height) and shape[1] is cols (width), so the row
range needs shape[0] and the column range needs shape[1]:
blank_frame[y:y+shape[0], x:x+shape[1]] = transparent_layer
The bug is masked for square images where shape[0]==shape[1]. For
non-square images (e.g. 1920x1080), it produces:
ValueError: could not broadcast input array from shape (1080,1920)
into shape (1620,1080)
This silently kills the birdseye output process -- no frames are
written to the FIFO pipe, go2rtc exec ffmpeg times out, and the
birdseye restream shows a black screen with no errors in the UI.
In both expire_snapshots() and expire_clips(), the expired_events
query uses .iterator() for lazy evaluation, but the very next line
calls list(expired_events) inside an f-string for debug logging.
This consumes the entire iterator, so the subsequent for loop that
deletes media files from disk iterates over an exhausted iterator
and processes zero events.
Snapshots and clips for removed cameras are never deleted from disk,
causing gradual disk space exhaustion.
Materialize the iterator into a list before logging so both the
debug message and the cleanup loop use the same data.
The cosine similarity calculation is guarded by:
if not np.any(np.linalg.norm(velocities, axis=1))
This enters the block when ALL velocity norms are zero, then divides
by those zero norms. The condition should check that all norms are
non-zero before computing cosine similarity:
if np.all(np.linalg.norm(velocities, axis=1))
Also fixes debug log that shows average_velocity[0] for both x and y
velocity components (second should be average_velocity[1]).
The connect() function creates a WebSocket but never stores the
reference. The useEffect cleanup only closes the RTCPeerConnection
via pcRef, leaving the WebSocket open.
Each time the component re-renders with changed deps (camera switch,
playback toggle, microphone toggle), a new WebSocket is created
without closing the previous one. This leaks connections until the
browser garbage-collects them or the server times out.
Store the WebSocket in a ref and close it in the cleanup function.
cv2.imread with IMREAD_UNCHANGED loads the image as-is, but the code
unconditionally indexes channel 3 (birdseye_logo[:, :, 3]) assuming
RGBA format. This crashes with IndexError for:
- Grayscale PNGs (2D array, no channel dimension)
- RGB PNGs without alpha (3 channels, no index 3)
- Fully transparent PNGs saved as grayscale+alpha (2 channels)
Handle all image formats:
- 2D (grayscale): use directly as luminance
- 4+ channels (RGBA): extract alpha channel (existing behavior)
- 3 channels (RGB/BGR): convert to grayscale
Also fixes the shape[0]/shape[1] swap in the array slice that breaks
non-square images (related to #6802, #7863).
In BirdsEyeFrameManager.update(), the exception handler on line 756
resets self.active_cameras to [] (a list), but it is initialized as
set() and compared as a set throughout the rest of the code.
Since set() \!= [] evaluates to True even though both are empty, the
next call to update_frame() will incorrectly detect a layout change
and trigger an unnecessary frame rebuild after every exception.
escape_special_characters() returns a ValueError object instead of
raising it when the input path exceeds 1000 characters. The exception
object gets used as a string downstream instead of triggering error
handling.
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.
gpu <= len(self._valid_gpus) should be gpu < len(self._valid_gpus).
The list is zero-indexed, so requesting gpu index equal to the list
length causes an IndexError. For example, with 2 valid GPUs (indices
0 and 1), requesting gpu=2 passes the check (2 <= 2) but
self._valid_gpus[2] is out of bounds.
The motionVisible condition gated the external dot (via onActiveMotionChange
callback) on liveReady, causing the dot to stay hidden for cameras in
continuous mode (showStillWithoutActivity=false) while the stream is loading
or reconnecting. Since the parent (DraggableGridLayout) renders the dot
outside the stream viewport, it should reflect actual motion state without
depending on stream load status.
Simplify the callback-path effect to use !!(autoLive && !offline &&
activeMotion) so the dot appears in the grid card whenever motion is active.
The full condition (including liveReady) is still used for the inline dot
rendered inside LivePlayer when no callback is provided.
https://claude.ai/code/session_019B4dJXtcxvHn97ZaqHUB62
getStats was always passed showStats (false in grid view), so underlying
players never collected stats data. Now uses showStats || !!onStatsUpdate
so players collect stats whenever the external callback is present.
https://claude.ai/code/session_019B4dJXtcxvHn97ZaqHUB62
Use useRef to store onStatsUpdate/onLoadingChange/onActiveMotionChange
callbacks so useEffect deps don't include the callback references.
Inline arrow functions in .map() change identity every render, causing
the previous useEffect([stats, onCallback]) to re-fire on each parent
re-render, triggering another setState → re-render → infinite loop.
https://claude.ai/code/session_019B4dJXtcxvHn97ZaqHUB62
Move PlayerStats, ActivityIndicator and motion dot rendering outside the
zoom transform div in DraggableGridLayout so they are not scaled when
the user zooms with Shift+Wheel.
- Add onStatsUpdate, onLoadingChange, onActiveMotionChange callback props
to LivePlayer; when provided, suppress the internal overlay elements
and bubble state up to the parent instead
- In DraggableGridLayout, maintain per-camera overlay states and render
the three overlays as siblings to the zoom div (inside the clipping
viewport) so they remain at natural size regardless of zoom level
https://claude.ai/code/session_019B4dJXtcxvHn97ZaqHUB62
Set margin and containerPadding to [0,0] in ResponsiveGridLayout,
removed px-2/my-2/pb-8 from the wrapper div, and updated cellHeight
formula to not account for margins.
https://claude.ai/code/session_01THf2SuS7hLt9NgstxvKdg8
When reduce_storage_consumption() encountered a FileNotFoundError
(file deleted outside Frigate), it silently skipped the recording
without removing it from the database. Over time this caused the DB
to accumulate stale entries, making "Frigate recordings tracked" in
/system#storage dramatically overstate actual disk usage.
The bug also affected cleanup behaviour: stale entries don't count
toward freed-space accounting, so Phase 2 (force-delete retained
recordings) could trigger prematurely when most old entries were stale.
Fix: always append the recording to deleted_recordings regardless of
whether the file existed, so the DB entry is removed. freed-space
accounting is unchanged — FileNotFoundError still does not increment
deleted_segments_size since no actual disk space was recovered.
Applied to both Phase 1 (non-retained) and Phase 2 (retained) loops
inside reduce_storage_consumption().
https://claude.ai/code/session_01DMdSSQhQfTuXmzPtRvJmLB
useLayoutEffect with [] deps only ran on the initial render when
gridContainerRef was null (grid div was hidden behind skeleton).
After skeleton disappeared the div mounted but useLayoutEffect never
re-ran, leaving containerWidth=0 and Responsive invisible (blank screen).
A callback ref fires every time the element mounts, so containerWidth
is always set immediately when the grid div first appears.
* fix double scrollbar in debug replay
* always hide ffmpeg cpu warnings for replay cameras
* add slovenian
* fix motion previews on safari and ios
match the logic used in ScrubbablePreview for manually stepping currentTime at the correct rate
* prevent motion recalibration when opening motion tuner
useResizeObserver reads ref.current during render (before commit), so on
first render ref.current is null, no observation starts, and containerWidth
stays 0 if no subsequent re-render happens (e.g. page refresh with cached
SWR data). useLayoutEffect runs after refs are committed, so ref.current
is always the real DOM element.
This fixes both the right-column overflow (no window.innerWidth fallback
needed — width is always the actual container width) and the black screen
on refresh (containerWidth is reliable before the first paint).
https://claude.ai/code/session_01H1sqbcFmtwwsdNTJcJHJWd
useResizeObserver reads ref.current at render time; on page refresh with
fast SWR cache, no re-render occurs after mount so ref.current remains null
in the effect, observation never starts, and containerWidth stays 0 forever.
Add a useLayoutEffect that measures offsetWidth synchronously before paint
as a seed value (effectiveWidth = containerWidth || initialWidth). Once
ResizeObserver fires normally, containerWidth takes over. The Responsive
grid is gated on effectiveWidth > 0 so it always renders correctly on both
first load and refresh.
https://claude.ai/code/session_01H1sqbcFmtwwsdNTJcJHJWd
Gate <Responsive> rendering on containerWidth > 0 so it only mounts after
ResizeObserver has measured the container. Use availableWidth directly as
the width prop (no window.innerWidth fallback) since the component now only
renders when containerWidth is known. This prevents the grid from rendering
wider than its container (which caused the rightmost column to overflow the
right edge).
https://claude.ai/code/session_01H1sqbcFmtwwsdNTJcJHJWd