Repository navigation
fix(web): keep markers another session changed when saving from the player - #4231
Conversation
…layer After a save from the player's Edit markers panel, the hook reported all four marker kinds from its draft. The draft's copy of a kind the save did not send is the snapshot taken when the panel opened, so the player put back a range another session had changed meanwhile. Report only the kinds the save wrote; the watch page already leaves the others alone. Closes Silo-Server#4101
|
Warning Review limit reachedThis organization requires a seat for paid usage-based reviews, including automatic and on-demand reviews. Ask an admin to assign a seat or enable paid usage-based reviews for users without a seat in Billing. Next included review available in 23 seconds. View limit details
|
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Review summaryReviewed head: No defects found. I pushed nothing to the branch. What I checked
Left for the maintainers
Validated features: none affected. #1153 C1 and C2 have not been run. #1149 C1 and C2 passed, but they cover the skip controls and never use the editor's save callback. User manual: no change needed. This fix makes the editor behave as expected. Other clients: I found no in-player marker editor in Apple, Android, or Roku, and no matching save path in jellycompat. The PR's N/A entries hold. Fit: 9/10 · Readiness: 9/10 — ready (assuming CI is green)
🤖 Claude Code (claude-opus-5-5) |
Problem
Closes #4101
Related issue: #1150
Validation tasks: none (the web marker-editing task #1153 has C1 and C2 not run yet; the skip-control cases on #1149 do not use the editor)
Other clients: Apple N/A (no in-player marker editor); Android N/A (no in-player marker editor); Roku N/A (no in-player marker editor)
If someone else changes a marker on a file while the web player's Edit markers panel is open, saving a different kind from that panel brings back the old value of the kind they changed. The server keeps the right markers, but the seek bar, and the panel when reopened, show a range the server no longer has until the player reloads or another marker update for the file arrives. This change makes the player show the server's markers after the save: the other person's change plus your own.
Approach
After a save, the editor hook reported all four kinds from its draft to the player. For kinds the save did not send, the draft holds the values from when the panel opened, and the watch page wrote them over the newer ranges the realtime
markers_updatedevent had already applied. The hook now reports only the kinds it sent (a cleared kind is still reported asnull).patchVersionMarkersalready leaves a kind alone when it gets none, so the watch page needed no change.Open PR #4135 also changes the
onSavedcall in this hook. Whichever lands second needs a small rebase. Its tests expect the callback to receive every kind, and they will need updating for this contract.Validation
pnpm run lint(no errors; no warnings in touched files),pnpm run format:check,tsc -b,pnpm run build,pnpm run budget:check,make test-web(883 files, 7463 tests) all pass.main.PUT /api/v2/markers/files/{file_id}; in the panel set a recap at 0:00–0:30 and save. Each run checked the save request, the seek bar, the reopened panel and the server's markers. Results are below.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-4231/
Surface and build: web player, Edit markers panel reopened after the save, desktop 1440 px and mobile web 390 px, local build of
mainat 43405eb and of this branch.Risks
None identified. The callback type changes from all four kinds to a partial set. The watch page is its only consumer.
Checklist
AI Disclosure
Note
Pass only edited marker kinds in
onSavedcallback fromuseMarkerEditorFixes a bug where saving markers from the player could overwrite marker kinds changed by another session. The save request body now contains only kinds whose ranges differ from the original snapshot, and
onSavedreceives that partial draft instead of the full one.onSavedinUseMarkerEditorParamsandonMarkersEditedinVideoPlayerPropsto acceptPartial<MarkerDraft>, with docs noting omitted kinds may be staleonSavedandonMarkersEditedin useMarkerEditor.ts and VideoPlayer.tsx must handle a partial draft; omitted kinds must be re-fetched or left untouchedMacroscope summarized c4fb21c.