Skip to content

fix(web): keep markers another session changed when saving from the player - #4231

Merged
Quick104 merged 1 commit into
Silo-Server:mainfrom
Rhainland:fix/4101-marker-save-other-kinds
Nov 15, 2026
Merged

Quick104 merged 1 commit into
Silo-Server:mainfrom
Rhainland:fix/4101-marker-save-other-kinds

Conversation

@Rhainland

@Rhainland Rhainland commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

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_updated event had already applied. The hook now reports only the kinds it sent (a cleared kind is still reported as null). patchVersionMarkers already leaves a kind alone when it gets none, so the watch page needed no change.

Open PR #4135 also changes the onSaved call 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

  • Web: 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.
  • The existing editor test now checks that the callback receives only the kinds the save sent. It fails on main.
  • Local build with the production web bundle, headless Chromium at 1440 px and 390 px. Steps: an episode with a manual intro at 3:30–4:30; open Edit markers; a second admin moves the intro to 3:20–4:20 through 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.
  • I also edited the intro alone with no concurrent change. The seek bar and panel showed the new range right after saving.
  • Go checks were not run because the change touches no Go code.

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 main at 43405eb and of this branch.

                     save request body                       seek bar regions   reopened panel intro   server intro
before (main)        {"recap":{"start_seconds":0,"end_seconds":30}}  [0,30] [210,270]   3:30 – 4:30            [200,260]
after (this branch)  {"recap":{"start_seconds":0,"end_seconds":30}}  [0,30] [200,260]   3:20 – 4:20            [200,260]

Risks

None identified. The callback type changes from all four kinds to a partial set. The watch page is its only consumer.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or how I checked a change nobody sees.

AI Disclosure

  • Harness: Claude Code (via T3 Code); Codex CLI for code review
  • Tool(s): Claude Code, Codex CLI, Playwright (headless Chromium), GitHub CLI
  • Model(s): claude-opus-5-5; gpt-6.1-sol (code review)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: independent reviews of the full branch diff by claude-opus-5-5 and gpt-6.1-sol, covering correctness, repository standards and the issue's requirements. Neither found anything to fix.

Note

Pass only edited marker kinds in onSaved callback from useMarkerEditor

Fixes 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 onSaved receives that partial draft instead of the full one.

  • Changes onSaved in UseMarkerEditorParams and onMarkersEdited in VideoPlayerProps to accept Partial<MarkerDraft>, with docs noting omitted kinds may be stale
  • Updates the save test in useMarkerEditor.test.tsx to assert the callback receives only the saved kinds
  • Behavioral Change: consumers of onSaved and onMarkersEdited in useMarkerEditor.ts and VideoPlayer.tsx must handle a partial draft; omitted kinds must be re-fetched or left untouched

Macroscope summarized c4fb21c.

…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
@coderabbitai

coderabbitai Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

This 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.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0a16548c-a3ed-458e-943a-e6f05f9c98d8
Commits

Reviewing files that changed from the base of the PR and between 436f0fb and c4fb21c.

Files selected for processing: 3

  • web/src/player/components/VideoPlayer.tsx
  • web/src/player/hooks/useMarkerEditor.test.tsx
  • web/src/player/hooks/useMarkerEditor.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@silo-triage silo-triage Bot added the size/S 0–49 added + deleted lines (all files); change volume, not priority. label Nov 15, 2026
@silo-kody

silo-kody Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@silo-triage silo-triage Bot added bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have priority: P2 Limited scope, workaround exists, or polish labels Nov 15, 2026
@Quick104

Copy link
Copy Markdown
Contributor

Review summary

Reviewed head: c4fb21cf47ff5f3fed3e723f9fa95e453499f208

No defects found. I pushed nothing to the branch.

What I checked

  • Main has not touched these three files since the branch point, and [bug] Saving one marker kind in the web player puts back the old value of a kind someone else changed #4101 is still open, so the PR is still needed.
  • The approach is the smallest fix in the right place. The watch page is the only consumer of onMarkersEdited, and patchVersionMarkers already leaves a kind unchanged when it gets undefined. Kinds the save did not send therefore keep whatever the realtime markers_updated event last applied, and so do the file's marker segments.
  • After a save, the hook's own draft still holds the opening snapshot for kinds that weren't sent. That has no effect: the panel closes after the save, and reopening it snapshots the host's current markers.
  • The changed test in useMarkerEditor.test.tsx fails on the merge base (the callback receives all four kinds) and passes on this head. tsc -b is clean, and the player's 245 Vitest tests pass.
  • A Codex (gpt-6.1-sol) review of the same head found nothing to fix. It ran the hook, wire converter, and patch helper together against mocked HTTP: the stale overwrite reproduced on the merge base and was gone on this head. Neither of us ran a live server; the PR's own evidence covers that.

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)

  • Fit: the PR fixes a real display bug in an existing feature without adding a setting, a field, or any new surface.
  • Readiness: no open concern in the code. The regression test fails on the base, and the author's before/after run shows the fix live.

🤖 Claude Code (claude-opus-5-5)

@Quick104
Quick104 merged commit 2cc78e4 into Silo-Server:main Nov 15, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have priority: P2 Limited scope, workaround exists, or polish size/S 0–49 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Saving one marker kind in the web player puts back the old value of a kind someone else changed

2 participants