FCE-3588: TrackDeviceController and TrackPublisher - #590
Open
MiloszFilimowski wants to merge 1 commit into
Open
Conversation
6 tasks
MiloszFilimowski
marked this pull request as ready for review
August 5, 2026 14:26
The camera/microphone controller ported from react-client's useTrackManager/useDeviceManager/useTrackMiddleware, preserving the pinned invariants: ideal-vs-exact deviceId constraints, enabled=false reapplied to fresh tracks while muted, selectDevice without a live track only records the selection, stopDevice performs no signalling call, pause/resume via replaceTrack + paused metadata, join auto-publish with TrackTypeError swallowed, and local-to-remote track-id resolution awaiting an in-flight addTrack. TrackPublisher is the narrow signalling adapter that keeps the controller free of Peer generics; LocalDeviceState is the controller's snapshot shape (ClientState wiring lands with the orchestrator).
MiloszFilimowski
force-pushed
the
tsunami/05-track-controllers
branch
from
August 5, 2026 15:05
14473b0 to
b745977
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #589.
Description
TrackDeviceController: the camera/microphone controller ported from react-client'suseTrackManager/useDeviceManager/useTrackMiddleware. Preserves the pinned behavioral invariants:idealdeviceId on init vsexacton explicit start/select,enabled=falsereapplied to fresh tracks while muted,selectDevicewithout a live track only records the selection,stopDeviceperforms no signalling call, mute/pause asreplaceTrack(null)+pausedmetadata (resume inverse), join auto-publish withTrackTypeErrorswallowed, and local→remote track-id resolution that awaits an in-flightaddTrack.TrackPublisher: narrow signalling adapter — keeps the controller free ofPeergenerics and confines the platform→DOM track cast.LocalDeviceStateinclientState.ts: the controller's snapshot shape (store wiring lands with the orchestrator in the next PR).Motivation and Context
This is the hardest concurrency logic in the SDK (FCE-3588's scope, shared with the microphone per FCE-3583) — moved into tsunami as a framework-free class, testable without React.
Documentation impact
Types of changes
not work as expected)