Repository navigation
fix(lint): read a media window's start through the parser - #8133
Conversation
|
Could you re-run that workflow? Thanks. |
`mediaTimeWindow` parsed `data-start` with a raw `Number()`. A negative start, which `readClipTiming` clamps to zero, produced a window entirely before zero, so `mediaWindowsOverlap` reported no overlap and `video_audio_double_source` missed a real duplicate-audio error. Read the window through `readClipTiming`, the same contract parser the renderer uses, and keep returning null when the start or duration is unknown.
d687aae to
383a58d
Compare
jrusso1020
left a comment
There was a problem hiding this comment.
Reviewed at 383a58ddf752103d07fa2d9d5c7c6383ef5163f1.
mediaTimeWindow now uses the canonical timing reader (packages/lint/src/utils.ts:242), including negative-start clamping. Unknown timing stays conservative, and the regression reproduces the duplicate-source overlap from #8132.
Need: yes · Size: ok · Reuse: readClipTiming and the existing overlap predicate · Simpler: already minimal · Structure: fine (checked existing callers and helpers; no split)
Risk: low — lint timing only.
Validation: bun run --cwd packages/lint test src/rules/media.test.ts --maxWorkers=2: 149 passed. Restoring the old utility makes the new negative-start regression fail (1 failed). Full workspace build passed at this head. Independent source cross-check found no blocker.
Verdict: APPROVE
Reasoning: The focused change addresses the reported behavior without introducing a blocking regression.
— Rames
|
All checks on |
What
mediaTimeWindownow readsdata-startthroughreadClipTiming, the same timing contract the renderer uses, instead of a rawNumber().Why
With a raw parse, a negative
data-startproduced a window entirely before zero.mediaWindowsOverlapthen reported no overlap andvideo_audio_double_sourcemissed a real duplicate-audio error.The renderer clamps the video start to 0, so both play
clip.mp4over0..2.Related work
Fixes #8132.
How
mediaTimeWindowreads the window throughreadClipTiming; a negative start is clamped to zero and an unknown start/duration still returnsnull.video_audio_double_source still fires when the video starts negative; it fails onmainand passes with the change.Test plan
packages/lint/src/rules/media.test.tsis 149 passed.@hyperframes/lint typecheckpasses.comment-ratchetandoxfmt --checkpass on the changed files.Commands run: