Skip to content

Internal: Fix double AudioContext close in keep-alive test - #12704

Merged
samohovets merged 1 commit into
mainfrom
fix-keep-alive-test-double-close
Oct 29, 2026
Merged

samohovets merged 1 commit into
mainfrom
fix-keep-alive-test-double-close

Conversation

@samohovets

Copy link
Copy Markdown
Member

#12634 made <Player> close its shared AudioContext on unmount. The keep-alive tests added in #12609 (merged around the same time) still close that same context after root.unmount(), which can throw InvalidStateError: Cannot close a closed AudioContext.

Seen on macOS CI in #12695: https://github.com/remotion-dev/remotion/actions/runs/40857074509

The Player now owns closing the context, so the test no longer closes it.

@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
bugs Ready Ready Preview Oct 29, 2026 12:41pm UTC
remotion Ready Ready Preview Oct 29, 2026 12:41pm UTC

Request Review

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Removes the manual audioContext.close() from the keep-alive test.each case in packages/media/src/test/audio-anchor-reschedule.test.tsx. The Player now closes its shared AudioContext in the useSingletonAudioContext cleanup on unmount (added in bb009af2f9), so the test's post-root.unmount() close was racing it into InvalidStateError: Cannot close a closed AudioContext. Since the Player owns the context's lifetime, dropping the redundant close is the right fix — the variable is still used above for the null check, so nothing is left unused.

Pullfrog  | Fix it ➔ | View workflow run | Using deepseek-v4.1-flash | 𝕏

@samohovets
samohovets merged commit 4d91a07 into main Oct 29, 2026
21 checks passed
@samohovets
samohovets deleted the fix-keep-alive-test-double-close branch October 29, 2026 13:01

This branch was successfully deployed

2 active deployments
Preview – remotion — 8411787b Deployed Oct 29, 2026 by vercel[bot]
Preview – bugs — 8411787b Deployed Oct 29, 2026 by vercel[bot]
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