Skip to content

fix(engine): media playlists are checked through every list they name - #7778

Merged
miguel-heygen merged 2 commits into
mainfrom
fix/playlist-nested
Nov 15, 2026
Merged

miguel-heygen merged 2 commits into
mainfrom
fix/playlist-nested

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

A media playlist is now checked through every list it names, not only its own lines. A master playlist pointing at a variant list in a subfolder, which in turn names a file outside the top folder, is refused before ffprobe or ffmpeg opens it. Nested lists are read up to 8 deep, each list once.

A downloaded file that is such a playlist is refused before it is saved under its final name, the same way the downloader already refuses HTML and JSON error documents. It never sits in the download folder for another list to name.

Why

The folder rule from #7768 has to hold for everything ffmpeg will follow, and ffmpeg follows nested lists.

Related work

Refs #7768.

How

  • playlistLeavesItsFolder walks local entries that are themselves playlists, resolving each against its own list's folder and keeping it inside the top list's folder. A chain deeper than 8 is refused. Lists already seen are skipped, so a cycle ends.
  • It takes an optional placedAt path, so the downloader can check the staged file as if it were already in the download folder.
  • downloadToTemp runs the check on the staged download and throws a non-retryable invalid_payload error, which callers already treat as a bad source.

Test plan

fails without the fix: packages/engine/src/utils/notMediaPayload.test.ts "refuses a list whose nested list names a file outside the top folder", "refuses a nested list that steps above the top folder from its own" and "refuses lists nested deeper than it reads" fail on main; packages/engine/src/utils/urlDownloader.test.ts "never publishes a downloaded playlist that ..." (2 cases) fail without the downloader check.

  • With the fix, three runs in a row: engine notMediaPayload, urlDownloader, urlDownloader.progress and urlDownloader.publicAddress tests 147 of 147. htmlCompiler.test.ts 183 of 183 under the unit lane's no-network preload, assetMediaType.test.ts 17 of 17, audio mixer tests 139 of 139.

  • On Linux with ffmpeg 8.0.1, a compile of a <video> pointing at a master list whose variant list names an outside file runs ffprobe twice and opens that file on main. With the fix it stops with the not-media error and ffprobe never runs (traced).

  • Mutations, each reverted and each caught: dropping the downloader check, ignoring placedAt, no recursion, no depth cap, no cycle guard, and checking nested entries against their own folder instead of the top one.

  • Engine and producer typecheck, oxlint and oxfmt clean.

  • Unit tests added/updated

  • Manual testing performed

  • Documentation updated (if applicable)

  • Comments follow CONTRIBUTING.md "Comments": they say why, not what, and a bug fix says what the code must do and how to reproduce the bug

@github-actions

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 267 (base branch 267), smooth 109 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (8)

Unstable (1)

  • seqab-none-pct-r0-root-z100: tracking 0.05, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.05, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.05, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true

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.

1 participant