Skip to content

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

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

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
Contributor

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
jrusso1020 added a commit that referenced this pull request Sep 4, 2026
Port the MIME mappings reported by fix2015 in #1836 to both render file servers.

Co-authored-by: vitalii.semianchuk <[email protected]>
@jrusso1020

Copy link
Copy Markdown
Collaborator

Thanks for the contribution! The remaining MIME fix is now merged in #3677 with your co-author credit, covering both file servers used by rendering. Downloader cleanup is already handled by attempt-scoped temporary directories and finally cleanup; the cosmetic edits were omitted. Closing this older PR as superseded.

@jrusso1020 jrusso1020 closed this Sep 4, 2026
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