Skip to content

fix: replace hardcoded 5s metadata timeout with dynamic file-size-awa…#1171

Open
Amitverma0509 wants to merge 1 commit into
magic-peach:mainfrom
Amitverma0509:fix/dynamic-metadata-timeout
Open

fix: replace hardcoded 5s metadata timeout with dynamic file-size-awa…#1171
Amitverma0509 wants to merge 1 commit into
magic-peach:mainfrom
Amitverma0509:fix/dynamic-metadata-timeout

Conversation

@Amitverma0509
Copy link
Copy Markdown

@Amitverma0509 Amitverma0509 commented May 25, 2026

Description

Replaced the hardcoded 5000ms timeout in extractMetadata with a file-size-aware helper getMetadataTimeout(fileSizeBytes) that scales the wait time based on how large the file is.

// before
}, 5000);

// after
const timeoutMs = getMetadataTimeout(file.size);
}, timeoutMs);

File size Timeout
0 – 100 MB 10 s
100 – 200 MB 20 s
200 – 300 MB 30 s
≥ 500 MB 60 s (cap)

The helper is exported so it can be unit tested independently.

Related Issue

Closes #1163

Type of Contribution

  • Bug fix
  • New feature
  • Documentation update
  • Refactor
  • GSSoC contribution

Participant Info

  • Contribution level (Beginner/Intermediate/Advanced): Intermediate

Screen Recording

No UI changes — pure logic fix. To verify manually:

  1. bun run dev → open http://localhost:3000
  2. Drop in a video > 200 MB — loads without timeout error
  3. Drop in a small file — still works fine
  4. Drop in a corrupt file — still rejected via onerror

Recording / Loom link: N/A

Checklist

  • I have read the contribution guidelines
  • My changes follow the project structure
  • I have tested my changes in Chrome, Firefox, and Safari
  • bun run lint passes (no ESLint errors)
  • bunx tsc --noEmit passes (no TypeScript errors)
  • New interactive elements have aria-label / accessible names — N/A
  • No console.log statements left in
  • This PR is related to a valid issue
  • Screen recording attached above — N/A (no UI change)

@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

@Amitverma0509 is attempting to deploy a commit to the magic-peach1's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown
Contributor

👋 Thanks for your PR, @Amitverma0509!

Welcome to Reframe — a browser-based video editor built for everyone 🎬

🟠 GSSoC'26 PR detected — thanks for contributing under GirlScript Summer of Code 2026!

What happens next

  1. 🤖 Automated checks — build & TypeScript typecheck will run automatically
  2. Vercel preview — a preview deployment will be created (requires maintainer authorization for fork PRs)
  3. 👀 Code review — a maintainer will review your changes
  4. 🚀 Merge — once approved, your PR will be merged!

Quick checklist

  • PR title follows Conventional Commits (e.g. feat: add dark mode)
  • Linked the issue this PR closes (e.g. Closes #123)
  • Tested the changes locally (bun run dev)
  • Build passes (bun run build)

Useful links

Happy coding! 🎉

@github-actions github-actions Bot added level:beginner Beginner level - 20 pts type:bug Bug fix type:design UI/UX design type:docs Documentation type:feature New feature type:refactor Code refactor type:testing Testing gssoc'26 GirlScript Summer of Code 2026 labels May 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 25, 2026

✅ PR Format Check Passed — @Amitverma0509

Basic format checks passed. A maintainer will review your code changes.

This does not mean the PR is approved — it just means the format is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc'26 GirlScript Summer of Code 2026 level:beginner Beginner level - 20 pts type:bug Bug fix type:design UI/UX design type:docs Documentation type:feature New feature type:refactor Code refactor type:testing Testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Hardcoded Metadata Timeout

1 participant