Skip to content

[BUG] Large Video Waveform Extraction Reads Entire File Into Memory and Crashes Browser Tabs#1051

Open
shubh-gitpush wants to merge 11 commits into
magic-peach:mainfrom
shubh-gitpush:video
Open

[BUG] Large Video Waveform Extraction Reads Entire File Into Memory and Crashes Browser Tabs#1051
shubh-gitpush wants to merge 11 commits into
magic-peach:mainfrom
shubh-gitpush:video

Conversation

@shubh-gitpush
Copy link
Copy Markdown

@shubh-gitpush shubh-gitpush commented May 24, 2026

Description

the video-related changes made on the video branch to prevent browser OOMs during waveform extraction, fix SSR hydration mismatches, and harden metadata extraction. The changes prioritize safety for large uploads while preserving existing behavior for small files.
--Prevent catastrophic browser memory spikes caused by calling File.arrayBuffer() on very large uploads.
--Fail waveform extraction gracefully and provide a fallback UI for skipped extraction.
--Avoid hydration mismatches by deferring browser-only reads to client useEffect.
--Add timeouts and guards when decoding media metadata or audio data to avoid hangs.

Related Issue-

#1013

Type of Contribution

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

Participant Info

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

Screen Recording

How to record: run bun run dev → open http://localhost:3000 → demonstrate the full working flow of your change, including any edge cases.

  • macOS: Cmd + Shift + 5 → Record Selected Portion, or use QuickTime Player
  • Windows: Win + G → Xbox Game Bar → Capture
  • Linux: OBS Studio, GNOME Screenshot tool, or kazam
  • Any OS: Loom (free screen recorder, great for sharing)

Recording / Loom link: ## 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
  • No console.log statements left in
  • This PR is related to a valid issue
  • Screen recording attached above (required for UI/feature/design changes)

@vercel
Copy link
Copy Markdown

vercel Bot commented May 24, 2026

@shubh-gitpush 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

github-actions Bot commented May 24, 2026

⚠️ PR Format Issues — @shubh-gitpush

Please fix the following before your PR can be reviewed:

  • ⚠️ Use a conventional PR title. Examples:
    • feat: add dark mode support
    • fix: resolve aria label missing on slider
    • docs: add deployment guide to README
  • ⚠️ No linked issue found. Add Closes #<issue-number> to your PR description.

Push new commits after fixing — this comment will update automatically.

📖 CONTRIBUTING.md

@github-actions
Copy link
Copy Markdown
Contributor

👋 Thanks for your PR, @shubh-gitpush!

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:advanced Advanced level - 55 pts type:bug Bug fix type:design UI/UX design type:docs Documentation type:feature New feature type:refactor Code refactor gssoc'26 GirlScript Summer of Code 2026 labels May 24, 2026
@magic-peach magic-peach removed type:feature New feature type:docs Documentation type:design UI/UX design type:refactor Code refactor labels May 24, 2026
@magic-peach
Copy link
Copy Markdown
Owner

@shubh-gitpush The changes here look solid — preventing OOM crashes by capping waveform extraction at 50MB, adding timeouts, and gracefully falling back with a UI message is exactly the right approach. The ThemeProvider fix to defer to localStorage in a useEffect also resolves the hydration mismatch cleanly.

However, CI did not run the build/lint/typecheck checks for this PR — only validate passed. I need all of build, lint, and typecheck to pass before merging.

Please make a small push to your branch to re-trigger the full CI suite:

git commit --allow-empty -m 'ci: trigger checks'
git push

Also, please fill in the checklist items (GitHub username, contribution level) in the PR description. Once all checks pass, this will be ready to merge!

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:advanced Advanced level - 55 pts type:bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants