Skip to content

FCE-3588: TrackDeviceController and TrackPublisher - #590

Open
MiloszFilimowski wants to merge 1 commit into
tsunami/04-device-foundationfrom
tsunami/05-track-controllers
Open

FCE-3588: TrackDeviceController and TrackPublisher#590
MiloszFilimowski wants to merge 1 commit into
tsunami/04-device-foundationfrom
tsunami/05-track-controllers

Conversation

@MiloszFilimowski

@MiloszFilimowski MiloszFilimowski commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #589.

Description

  • TrackDeviceController: the camera/microphone controller ported from react-client's useTrackManager / useDeviceManager / useTrackMiddleware. Preserves the pinned behavioral invariants: ideal deviceId on init vs exact on explicit start/select, enabled=false reapplied to fresh tracks while muted, selectDevice without a live track only records the selection, stopDevice performs no signalling call, mute/pause as replaceTrack(null) + paused metadata (resume inverse), join auto-publish with TrackTypeError swallowed, and local→remote track-id resolution that awaits an in-flight addTrack.
  • TrackPublisher: narrow signalling adapter — keeps the controller free of Peer generics and confines the platform→DOM track cast.
  • LocalDeviceState in clientState.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

  • Documentation update required
  • Documentation updated in another PR
  • No documentation update required

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)

@MiloszFilimowski MiloszFilimowski changed the title tsunami: TrackDeviceController + TrackPublisher FCE-3588: TrackDeviceController and TrackPublisher Aug 5, 2026
@linear

linear Bot commented Aug 5, 2026

Copy link
Copy Markdown

FCE-3588

FCE-3583

@MiloszFilimowski
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
MiloszFilimowski force-pushed the tsunami/05-track-controllers branch from 14473b0 to b745977 Compare August 5, 2026 15:05
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