Skip to content

fix: dead code cleanup, missing MIME types, partial download leak#1836

Open
fix2015 wants to merge 1 commit into
heygen-com:mainfrom
fix2015:fix/dead-code-mime-types-and-cleanup
Open

fix: dead code cleanup, missing MIME types, partial download leak#1836
fix2015 wants to merge 1 commit into
heygen-com:mainfrom
fix2015:fix/dead-code-mime-types-and-cleanup

Conversation

@fix2015

@fix2015 fix2015 commented Jul 1, 2026

Copy link
Copy Markdown

A few things I noticed while going through the codebase:

  • `formatSpeed` had a ternary where both branches returned the exact same string — simplified it
  • the file server's MIME type map was missing avif, flac, m4a, mov, and ico, so those formats were being served as `application/octet-stream` which breaks browser rendering
  • `parseObjectPositionAxis` had an unreachable branch — the axis param is typed as `"x" | "y"` so the guard is always true
  • when a download fails midway in `downloadToTemp`, the partial file was left on disk. on the next call it would find that partial file and return it as if it succeeded. now cleans up the partial in the catch block
  • added a description to @hyperframes/core package.json — it was empty

- formatSpeed had identical branches in its ternary — simplified
- file server was missing MIME types for avif, flac, m4a, mov, ico so
  those files got served as application/octet-stream
- removed unreachable guard in parseObjectPositionAxis
- partial downloads weren't cleaned up on failure so the next call would
  find and use the corrupted file — now removes partials in catch block
- added description to @hyperframes/core package.json
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.

1 participant