This repository has no description

fix(player): useSonare destructure shadowed Number; dashboard metrics deps non-reactive master

useSonare destructured the length option as `number`, shadowing the global Number constructor and binding to undefined. The state initializer and regenerate callback both called generateSonare(number, suffixLength), producing strings like 'undefined-undefined-undefined-abc'. The result is used as a React key in player.tsx and a session id in player.tsx, so this affected actual behavior. Rename the param to length. DashboardMetricsProvider's bitrate, FPS, and segment-timing effects had store.getState().segment?.size (and similar) in their dep arrays. getState() is not reactive, so the effects ran once on mount and never updated. The bitrate and FPS refs were stuck at their initial values for the lifetime of the provider. Subscribe to the slice via useStore and depend on the reactive segment value instead. Also drop the let [sona, resetSona] = useSonare() in PlayerBackend (should be const) and remove the now-unused latestInputsRef and useShallow import from the metrics provider.


+21 -40
2 changed files