Skip to content

Remove a customer's video from disk once its frame is read - #37

Merged
aryanorastar merged 1 commit into
BasedHardware:mainfrom
singhharsh1708:fix/remove-video-temp-files
Oct 11, 2026
Merged

aryanorastar merged 1 commit into
BasedHardware:mainfrom
singhharsh1708:fix/remove-video-temp-files

Conversation

@singhharsh1708

Copy link
Copy Markdown
Contributor

Customer problem

Every video a customer attaches is left on the server's disk. extractVideoFrame writes 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 finally block, 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

  • Added or updated a focused behavior test: one in test/attachments.test.js runs the real frame step on a clip that is not a video and checks no vec- folder is left. It fails on main with the folder still there
  • npm test: 627/627
  • EVAL_NO_MODEL=1 node scripts/customer-eval.js: 8/8
  • Live-model evaluation not needed: no prompt, routing or model path changes
  • No secrets, customer PII, .env, or railway.toml
  • No new claim that a person was pinged, an issue was filed, or an email was sent without confirmed success

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.
@aryanorastar
aryanorastar merged commit 29c40ee into BasedHardware:main Oct 11, 2026
3 checks passed
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.

2 participants