Skip to content

fix/concurrent-ffmpeg-loader-race#1060

Open
Pranav-IIITM wants to merge 2 commits into
magic-peach:mainfrom
Pranav-IIITM:fix/concurrent-ffmpeg-loader-race
Open

fix/concurrent-ffmpeg-loader-race#1060
Pranav-IIITM wants to merge 2 commits into
magic-peach:mainfrom
Pranav-IIITM:fix/concurrent-ffmpeg-loader-race

Conversation

@Pranav-IIITM
Copy link
Copy Markdown
Contributor

Description

Fixes a race condition in src/lib/ffmpeg.ts where concurrent calls to
loadFFmpeg() during the async initialization window could trigger multiple
simultaneous ffmpeg.load() calls on the same WASM instance, corrupting
internal worker state.

Introduces a shared loadingPromise guard so all concurrent callers share
a single initialization flow. Failed loads reset both ffmpegInstance and
loadingPromise to allow safe retries.


Related Issue

Closes #1014


Type of Contribution

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

Participant Info


Screen Recording

Not applicable — this is a runtime race condition fix with no UI changes.

Recording / Loom link: N/A — no UI changes


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 (N/A — no UI changes)

@vercel
Copy link
Copy Markdown

vercel Bot commented May 24, 2026

@Pranav-IIITM 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, @Pranav-IIITM!

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 labels May 24, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 24, 2026

⚠️ PR Format Issues — @Pranav-IIITM

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

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

📖 CONTRIBUTING.md

@github-actions github-actions Bot added the gssoc'26 GirlScript Summer of Code 2026 label May 24, 2026
@Pranav-IIITM
Copy link
Copy Markdown
Contributor Author

Hey @magic-peach

Just wanted to flag something — this issue (#1014) was originally labeled
level:advanced by you, but it appears the bot has since
relabeled it as level:beginner .

Could you please restore the level:advanced label? The fix involves
resolving a WASM runtime race condition with a shared pending-load promise
guard, which is non-trivial and aligns with the advanced classification
you originally assigned.

Thanks!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Concurrent FFmpeg Loader Calls Can Double-Initialize the Same WASM Runtime and Corrupt Internal State

1 participant