Repository navigation
Remove a customer's video from disk once its frame is read - #37
Merged
aryanorastar merged 1 commit intoOct 11, 2026
Merged
Conversation
extractVideoFrame wrote the clip and the frame into a new temp folder and never removed it, so every video a customer attached stayed on the server's disk, up to 8 MB each, whether or not a frame came out. The folder is now removed in a finally block.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Customer problem
Every video a customer attaches is left on the server's disk.
extractVideoFramewrites the clip and the frame into a new temp folder (vec-…) and never removes it, whether a frame came out or not. That is up to 8 MB of a customer's attachment per video, kept until the container is replaced.Change
The folder is removed in a
finallyblock, so it goes on success, on an ffmpeg failure and on a throw.Evidence
The frame is returned in memory and nothing reads the folder afterwards, so there is no reason for the clip to stay. The text attachment path keeps nothing on disk either.
Verification
test/attachments.test.jsruns the real frame step on a clip that is not a video and checks novec-folder is left. It fails on main with the folder still therenpm test: 627/627EVAL_NO_MODEL=1 node scripts/customer-eval.js: 8/8.env, orrailway.toml