Repository navigation
Fix video trimmer recording failures - #3470
vedanth-jadhav wants to merge 2 commits into
Conversation
|
Someone is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
| it("discards recorder errors instead of publishing partial output", async () => { | ||
| await startTrim(); | ||
| Recorder.instances[0]?.onerror?.(); | ||
| await vi.waitFor(() => | ||
| expect(container.textContent).toContain("Recording failed"), | ||
| ); | ||
| expect(stopTrack).toHaveBeenCalledOnce(); | ||
| expect(madeUrls).not.toContain("blob:output"); | ||
| }); |
There was a problem hiding this comment.
Timeout failures lack coverage
The new tests never exercise the timeout that now rejects a stalled trim instead of publishing partial output. A regression could bring back partial downloads without failing these tests.
Add a fake-timer test that advances past the deadline and checks the error, recorder shutdown, canvas-track cleanup, and absence of an output URL. Also check that a late stop event cannot publish the failed recording.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/web/__tests__/unit/trimming-tool-recording-failure.test.ts
Line: 134-142
Comment:
**Timeout failures lack coverage**
The new tests never exercise the timeout that now rejects a stalled trim instead of publishing partial output. A regression could bring back partial downloads without failing these tests.
Add a fake-timer test that advances past the deadline and checks the error, recorder shutdown, canvas-track cleanup, and absence of an output URL. Also check that a late stop event cannot publish the failed recording.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Addressed in e734fea: the new fake-timer regression advances past the timeout and checks the error, recorder shutdown, canvas-track cleanup, absence of an output URL, and a late stop callback.
|
@greptile review |
Problem
If preview playback is rejected while trimming, the recorder keeps running and its safety timer can later publish a partial video. Recorder errors and unexpected stops can also leave the trimmer stuck or publish incomplete output. The canvas capture track is retained after a successful trim.
Changes
Validation
getVideoTracks()to match the browser API used here.Tests use media API stand-ins; a full web build and physical capture were not run.


Confidence Score: 5/5
The PR appears safe to merge, with the previous coverage gap addressed.Summary
The PR stops failed or cancelled trims, releases canvas capture tracks, and prevents partial downloads.
Reviews (2) · Last reviewed commit: "Test trimmer timeout cleanup" · Reviewed by Greptile