Skip to content

fix(watch): close MultiBackend's sync and sources#1399

Open
skirsten wants to merge 1 commit into
moq-dev:mainfrom
skirsten:fix/multibackend-close-sync-sources
Open

fix(watch): close MultiBackend's sync and sources#1399
skirsten wants to merge 1 commit into
moq-dev:mainfrom
skirsten:fix/multibackend-close-sync-sources

Conversation

@skirsten
Copy link
Copy Markdown
Contributor

MultiBackend.close() only closed its own #runElement signal, leaving the Sync and the two Source instances (constructed as fields, not inside an Effect) alive. Each owns its own Effect with several .run() handlers that never get cleaned up, surfacing as "Signals was garbage collected without being closed" warnings whenever a watch component unmounts.

Close them explicitly, ordered so inner Decoder/Renderer/Emitter (spawned via the #runElement effect) finish before the sources/sync they reference are torn down.

MultiBackend.close() only closed its own #runElement signal, leaving
the Sync and the two Source instances (constructed as fields, not
inside an Effect) alive. Each owns its own Effect with several .run()
handlers that never get cleaned up, surfacing as "Signals was garbage
collected without being closed" warnings whenever a watch component
unmounts.

Close them explicitly, ordered so inner Decoder/Renderer/Emitter
(spawned via the #runElement effect) finish before the sources/sync
they reference are torn down.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 10f57718-6334-4867-82d1-bfe23fc9dd4c

📥 Commits

Reviewing files that changed from the base of the PR and between 6adf3c3 and 0271f05.

📒 Files selected for processing (1)
  • js/watch/src/backend.ts

Walkthrough

This PR expands the MultiBackend.close() method to actively release internal media and streaming resources. Previously, the method only terminated the signals effect. The updated implementation now additionally closes the private #videoSource and #audioSource fields and terminates the sync component, ensuring complete resource cleanup when the backend is shut down.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: closing MultiBackend's sync and sources, which directly matches the primary fix in the changeset.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, explaining the problem, the solution, and the cleanup order.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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