Repository navigation
fix(studio): preserve identity for stale metadata completions - #6755
Conversation
Edit accuracy: accurate 271 (base branch 271), smooth 131 of thoseThe gate passes. Quarantined, measured but not gated (0) |
There was a problem hiding this comment.
Verdict: APPROVE · 0 blocker · 0 important · 1 nit · head f6c09ce8
nit inline.
Scope
Zustand 5 only notifies subscribers when the callback's result is a different object from the current state. Returning {} built a new merged state on every stale completion, so every subscriber was notified; returning state notifies none. I found no other setState callback in packages/studio/src that returns {} the same way. The first CI run for this head is fully green, including Test (studio) and Flake gate. The second run came from a description edit and skipped its test jobs. The red PR captures run predates the ## No visible change section, and the rerun passed.
…and advance the watermark 107 commits, 123 PRs and 3 issues reviewed in total; no product change adopted. Executed from the roadmap's near-term table; the finished row is removed in the same commit. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: SanHsien <[email protected]>
Summary
Late media metadata can notify every player-store subscriber after a clip has been removed or already enriched. Preserve the existing state identity for those completions; valid duration updates still publish normally.
The regression test mounts the player hook and uses the real metadata queue, URL deduplication, and WAV parser with controlled fetch responses. Its fixture sends two overlapping timelines for 600 clips sharing 30 sources, then removes 20 clips and enriches 20 before the probes finish.
Validated against source tag
v0.8.216(6df754fbf): 62 hook, seek, and metadata tests pass; reverting the guard reproduces the 640-notification failure, and restoring it passes. Changed-file lint, formatting, comment checks, and workspace builds pass. These measurements establish notification behavior, without asserting a playback FPS improvement.No visible change
The product change preserves identity for a state that already has the requested result. It changes notifications without changing rendered output.