Skip to content

FCE-3322: Fix react native MediaStreamTrack#539

Merged
MiloszFilimowski merged 1 commit into
mainfrom
mfilimowski/fce-3322-fix-mediastream
May 21, 2026
Merged

FCE-3322: Fix react native MediaStreamTrack#539
MiloszFilimowski merged 1 commit into
mainfrom
mfilimowski/fce-3322-fix-mediastream

Conversation

@MiloszFilimowski
Copy link
Copy Markdown
Collaborator

Description

  • Re-export MediaStreamTrack from @fishjam-cloud/react-native-webrtc so mobile consumers get the RN-native track type.
  • Override Track and RemoteTrack so their track field is typed as RNMediaStreamTrack instead of the web type.
  • Override useCamera, useMicrophone, useScreenShare results (and middleware types) to use RN media types for startCamera/startMicrophone returns, videoTrack/audioTrack, and
    *Middleware setters.
  • Move MiddlewareResult, TrackMiddleware, TracksMiddleware, TracksMiddlewareResult exports to the mobile overrides.

Motivation and Context

The mobile client was leaking the web MediaStreamTrack type through hooks and track objects, causing type mismatches for RN consumers. This aligns all media track types with
react-native-webrtc.

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 requested a review from Copilot May 21, 2026 10:36
@linear
Copy link
Copy Markdown

linear Bot commented May 21, 2026

FCE-3322

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes React Native type leakage by ensuring the mobile client surfaces React Native WebRTC media types (not DOM/web types) through its public hook results and track objects.

Changes:

  • Re-export MediaStreamTrack from @fishjam-cloud/react-native-webrtc via the mobile client entrypoint.
  • Update mobile override types (Track, RemoteTrack, and device hook results) so track, videoTrack, audioTrack, and startCamera/startMicrophone returns are typed as RNMediaStreamTrack.
  • Move MiddlewareResult/TrackMiddleware/TracksMiddleware/TracksMiddlewareResult exports to the mobile override types and adapt hook wrappers to accept RN-typed middleware.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/mobile-client/src/overrides/types.ts Switches public mobile override types from web MediaStreamTrack to RN MediaStreamTrack, and defines RN-typed middleware/result types.
packages/mobile-client/src/overrides/hooks.ts Wraps middleware setters and casts hook results so consumers see RN media types for tracks and middleware.
packages/mobile-client/src/index.ts Re-exports MediaStreamTrack from RN WebRTC and re-exports middleware types from the mobile overrides instead of the web client.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MiloszFilimowski MiloszFilimowski merged commit e066486 into main May 21, 2026
6 checks passed
@MiloszFilimowski MiloszFilimowski deleted the mfilimowski/fce-3322-fix-mediastream branch May 21, 2026 13:04
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.

3 participants