| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Miscellaneous fixes (#23619) * fix stale active object indicators on the live dashboard The camera_activity/<camera> snapshot cache is only written when a client sends onConnect, and object "end" events only update the local state of mounted useCameraActivity hooks, never the cache. As a result, a hook that seeded from a stale cache or missed an "end" event while disconnected showed objects that had already left, with no path to correct itself short of a full page reload. This change will re-request the snapshot on hook mount (collapsed to one onConnect per task across camera cards), and always re-notify camera_activity topics so hooks reconcile against their own local state instead of relying on snapshot-vs-snapshot comparison, and clear the payload dedup cache on reconnect and resync so byte-identical snapshots still apply. * docs tweaks * fix mqtt log message * use consistent values for lpr debug frame filenames with millisecond resolution * apply object events through a functional updater to prevent lost updates The events effect derived a new objects list from the value captured at render time and wrote the whole list back. When events arrived close together, a run derived from a stale list erased a concurrent run's removal; the resurrected object then had no remaining "end" event to clear it, and the add branch could mint a duplicate entry that no splice could ever remove, leaving the live dashboard showing active objects the backend had already cleared, until a page reload. The fix is to apply each event inside setObjects so it operates on the true current list exactly once. Unchanged results return the same reference so React bails out of re-rendering, and the label rewrite is hoisted so added objects get the sub_label/verified label directly instead of relying on the effect re-running against its own state update. | 2 个月前 | |
Miscellaneous fixes (#21141) * Remove source_type from API * Don't require state classification models to select all classes * Specifically validate provided end_time for manual events * Remove yolov9 specification for warning * Remove warning for coral * clarify zone name tip * clarify replace rules in lpr docs * remove periods * Add explanation for review report * adjust HLS gap controller params defaults to false, should help to recover from hangs and stalling in tracking details videos on chrome * only redirect to login page once on 401 attempt to fix ios pwa safari redirect storm * Use contextual information from other cameras to inform report summary * Formatting and prompt improvements for review summary report * More improvements to prompt * Remove examples * Don't show admin action buttons on export card * fix redirect race condition Coordinate 401 redirect logic between ApiProvider and ProtectedRoute using a shared flag to prevent multiple simultaneous redirects that caused UI flashing. Ensure both auth error paths check and set the redirect flag before navigating to login, eliminating race conditions where both mechanisms could trigger at once --------- Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> | 8 个月前 | |
Fix linter and fix lint issues (#10141) | 2 年前 | |
Replace react-tracked and react-use-websocket with useSyncExternalStore (#22386) * refactor websockets to remove react-tracked react 19 removed useReducer eager bailout, which broke react-tracked. react-tracked works by wrapping state in a JavaScript Proxy. When a component reads state.someField, the proxy records that access. On the next state update, it compares only the fields each component actually touched and skips re-renders if those fields are unchanged. Under the hood, this relies on useReducer — and in React 18, useReducer had an "eager bail-out" that short-circuited rendering when the new state was === to the old state. React 19 removed that optimization, so every dispatch now schedules a render regardless, and the proxy comparison runs too late to prevent it. useSyncExternalStore is a React primitive (added in 18, stable in 19) designed for exactly this pattern: subscribing to an external store: useSyncExternalStore( subscribe, // (listener) => unsubscribe — called when the store changes getSnapshot // () => value — returns the current value for this subscriber ) React calls getSnapshot during render and compares the result with Object.is. If the value is the same reference, the component bails out — no re-render. The key difference from react-tracked is that this bail-out is built into React's reconciler, not bolted on via proxy tricks and useReducer. The per-topic subscription model makes this efficient. Instead of one global store where every subscriber has to check if their fields changed, each useWs("some/topic", ...) call subscribes only to that topic's listener set. When a message arrives for front_door/detect/state, only components subscribed to that exact topic get their listener fired → React calls their getSnapshot → Object.is compares the value → bail-out if unchanged. Components watching back_yard/detect/state are never even notified. * remove react-tracked and react-use-websocket * refactor usePolygonStates to use ws topic subscription * fix TimeAgo refresh interval always returning 1s due to unit mismatch (seconds vs milliseconds) older events now correctly refresh every minute/hour instead of every second * simplify * clean up * don't resend onconnect * clean up * remove patch | 5 个月前 | |
fix notification suspend state lost on page reload (#23989) <camera>/notifications/suspended arrives as a string over the live connection but as a number in the camera_activity snapshot, and the truthiness guard dropped the numeric 0, so a camera with notifications off rendered as active after a reload. Normalize to a string and derive isSuspended instead of storing it. | 22 天前 | |
Replace react-tracked and react-use-websocket with useSyncExternalStore (#22386) * refactor websockets to remove react-tracked react 19 removed useReducer eager bailout, which broke react-tracked. react-tracked works by wrapping state in a JavaScript Proxy. When a component reads state.someField, the proxy records that access. On the next state update, it compares only the fields each component actually touched and skips re-renders if those fields are unchanged. Under the hood, this relies on useReducer — and in React 18, useReducer had an "eager bail-out" that short-circuited rendering when the new state was === to the old state. React 19 removed that optimization, so every dispatch now schedules a render regardless, and the proxy comparison runs too late to prevent it. useSyncExternalStore is a React primitive (added in 18, stable in 19) designed for exactly this pattern: subscribing to an external store: useSyncExternalStore( subscribe, // (listener) => unsubscribe — called when the store changes getSnapshot // () => value — returns the current value for this subscriber ) React calls getSnapshot during render and compares the result with Object.is. If the value is the same reference, the component bails out — no re-render. The key difference from react-tracked is that this bail-out is built into React's reconciler, not bolted on via proxy tricks and useReducer. The per-topic subscription model makes this efficient. Instead of one global store where every subscriber has to check if their fields changed, each useWs("some/topic", ...) call subscribes only to that topic's listener set. When a message arrives for front_door/detect/state, only components subscribed to that exact topic get their listener fired → React calls their getSnapshot → Object.is compares the value → bail-out if unchanged. Components watching back_yard/detect/state are never even notified. * remove react-tracked and react-use-websocket * refactor usePolygonStates to use ws topic subscription * fix TimeAgo refresh interval always returning 1s due to unit mismatch (seconds vs milliseconds) older events now correctly refresh every minute/hour instead of every second * simplify * clean up * don't resend onconnect * clean up * remove patch | 5 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 个月前 | ||
| 8 个月前 | ||
| 2 年前 | ||
| 5 个月前 | ||
| 22 天前 | ||
| 5 个月前 |