Skip to content

fix(web): restore version liveness and stop false version notices - #450

Closed
randrini wants to merge 2 commits into
mainfrom
fix/web-v1-versions-and-notice
Closed

randrini wants to merge 2 commits into
mainfrom
fix/web-v1-versions-and-notice

Conversation

@randrini

Copy link
Copy Markdown
Collaborator

Problem

Two web-client defects from the QA matrix.

The item page and version menus still call POST /api/v1/catalog/versions/check, a business route the upstream sync retired (#443). In a 30-minute run the item page issued 26 of those calls; all 26 returned 410 with the 448-byte problem body, and the client made zero calls to /api/v2/catalog/versions/check. Because the check never answers, available, failed, and source_mismatch verdicts never reach the rows: version liveness and availability marking are dead in the UI.

The version-swap notice keys on requested_media_file_id !== effective_media_file_id. A sibling mirror of the same release is a different catalog row, so every virtual play of such a release showed "Playing a different version than selected — the requested version isn't playable on this device." while the same release played, tone-mapped, on the device.

Related issue: N/A

Validation tasks: none

Approach

Liveness now calls checkCatalogVersions at POST /api/v2/catalog/versions/check. The v2 contract renders file ids as opaque strings, so the request sends strings and the adapter restores the numeric ids the menus key on; a value that names no row is dropped instead of keyed under NaN. The operation is classified as a read, so a stalled check still hits the read deadline.

The notice now compares release identity instead of only the row id. The plan's substituted_from_file_id is the server's substitution signal when present. Without it, two rows are the same release when their release names match, or when their declared size and encode fingerprint match. Same-release movement stays quiet. A provably different release still shows the notice. When the rows cannot identify a release and the server sent no signal, the client makes no claim rather than guessing.

The From release listing provenance label from #446 is not on main: #446 was never merged, and #445, which did land, deliberately keeps declared placeholder rows in discovery until probe evidence arrives. Nothing was restored, because restoring #446's behavior would undo #445's fix for fabricated track rows.

Validation

  • npx tsc -b: passed.
  • Focused Vitest: the liveness, substitution, watch-page, and item-page files passed, along with the existing MovieContent, useStampedVersions, ActionBar.inventory, WatchRoute, WatchPlaybackChrome.requestedVersion, and v2 request tests.
  • ESLint on touched files: 0 errors. The three react-refresh warnings in WatchPage.tsx are pre-existing.
  • Prettier on touched files: clean.
  • make verify-local-paths: passed.
  • Fail-before check on main's production code: the liveness test records no v2 call; the item-page test never reaches /api/v2/catalog/versions/check; the sibling-mirror and unknown cases render the false notice.

Evidence: none beyond the request paths and notice behavior described here.

Risks

Low. Liveness remains one batched POST per chunk of 40. The notice can stay quiet in cases the client cannot prove a substitution; that is intentional, and a server-published substituted_from_file_id still produces it.

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 says there is none.

AI Disclosure

Posted by an AI agent (Muse Spark, OpenCode harness).

  • Harness: OpenCode
  • Tool(s): OpenCode agent tools
  • Model(s): Muse Spark
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: n/a

The item page and both version menus posted to /api/v1/catalog/versions/check, which the upstream sync retired: every request answered 410, so every row stayed at its snapshot availability.

Call checkCatalogVersions at POST /api/v2/catalog/versions/check. The v2 contract renders file ids as opaque strings, so the request sends strings and the response adapter restores the numeric ids the menus key on (dropping a value that names no row). Treat the call as the read it is, so a stalled check still hits the read deadline.
The version-swap notice treated any effective row id different from the requested one as a substitution. A sibling mirror of the same release has its own row, so every virtual play of such a release claimed the chosen version was not playable on the device while the same release played fine.

Decide the notice from release identity rather than the row id: the plan's substituted_from_file_id is the server's substitution signal, and without it two rows are compared by release name, then declared size plus encode fingerprint. Same-release movement stays quiet, a provably different release still speaks, and an unidentifiable pair makes no claim instead of guessing.
@randrini

Copy link
Copy Markdown
Collaborator Author

Superseded by #459, which contains this change plus the rest of the playback reliability bundle. Closing to keep the review surface to one PR.

@randrini randrini closed this Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants