Repository navigation
fix(producer): a failed video extraction names which clip files failed - #6905
Conversation
There was a problem hiding this comment.
Verdict: REQUEST CHANGES · 1 blocker · 0 important · 0 nits · head 8f2d1d17
The fails without the fix: line names a real test. The blocker is that videoExtractionSourceLabel can still print an absolute path, or a whole inline payload, into the message (see the inline comment).
Scope
Read all 4 files at head, plus resolveProjectRelativeSrc/cleanAssetUrl in parsers and resolveMediaElementSrc. Ran the label logic locally on non-http schemes. CI was still running when I reviewed, so this verdict is on the code only.
| return "remote video"; | ||
| } | ||
| } | ||
| const path = src.split(/[?#]/)[0]!; |
There was a problem hiding this comment.
blocker: any non-http scheme falls through to normalize() and is printed as-is. That breaks the "no host, query, fragment or absolute path" promise in the docstring and the PR body. Locally, with baseDir /proj:
file:///Users/me/private/a.mp4→file:/Users/me/private/a.mp4(absolute path and username). The engine doesn't resolvefile://srcs, so this src always fails and always reaches the message.data:video/mp4;base64,AAAA…→ the whole base64 payload.resolveMediaElementSrcpassesdata:srcs through, so an inlined clip puts megabytes intoerror.messageand the logs.HTTPS://cdn/x.mp4(upper case) →HTTPS:/cdn/x.mp4(host), becauseisHttpUrlis case-sensitive.
Suggested fix: before the local branch, handle any ^[a-z][a-z0-9+.-]+: scheme (two or more characters, so C:\ drive paths still count as local). data:/blob: → a fixed label such as inline video; any other scheme → basename(new URL(src).pathname), with the existing remote video fallback. Match http case-insensitively too. Then add file:, data: and upper-case HTTPS: cases to the label test.
Edit accuracy: accurate 271 (base branch 271), smooth 124 of thoseThe gate passes. Quarantined, measured but not gated (0) Unstable (1)
|
8f2d1d1 to
7fe07b6
Compare
There was a problem hiding this comment.
Verdict: APPROVE — 1 resolved, 0 open, 0 new · 8f2d1d17 → 7fe07b68 (rebased onto main). data:/blob: srcs now print inline video. Any other scheme, at any case, prints only its file name, and drive and UNC paths go through win32. The new label test covers file:, data:, blob:, ftp:, upper-case HTTPS: and both Windows cases.
What
When video extraction fails, the error now names the failed clip files, project-relative:
Video extraction failed for 2 source(s) [VIDEO_SOURCE_UNRENDERABLE; invalid_media=2] (assets/a.mp4, assets/b.mp4). Up to five names, thenand N more.Why
An export with many video clips failed with
Video extraction failed for 1 source(s) [VIDEO_SOURCE_UNRENDERABLE; invalid_media=1]and nothing said which of the clips it was, so the author had to bisect the project by hand.How
sourceat the one place the result is assembled (extractAllVideoFrames): a project-relative path, or for a remote source only its file name (no host, query or fragment), or the file name for a path outside the project.VideoExtractionStageErrorappends the sorted, de-duplicated names to its message. The code, the kind counts andpublicMetadataare unchanged, so nothing that parses them moves.Test plan
fails without the fix: packages/producer/src/services/render/stages/extractVideosStage.test.ts › assertVideoExtractionSucceeded › names the failed clips, at most five, in the message and nowhere else
extractAllVideoFrameson a missing local file reportssource: "assets/missing.mp4".videoFrameExtractor.test.tsandextractVideosStage.test.ts: 253 passed, 3 runs in a row. Against main, 3 of the new tests fail (nosource, message without names).Size
Under 100 lines, but it stands alone: it changes one engine result type and the one error that reads it; splitting would leave either an unused field or a message with nothing to print.