FCE-3586: device foundation — classified errors, platform types, mediaInitializer - #589
Open
MiloszFilimowski wants to merge 1 commit into
Open
FCE-3586: device foundation — classified errors, platform types, mediaInitializer#589MiloszFilimowski wants to merge 1 commit into
MiloszFilimowski wants to merge 1 commit into
Conversation
6 tasks
MiloszFilimowski
marked this pull request as ready for review
August 5, 2026 14:26
… mediaInitializer DeviceError classes with legacy name literals and recoverability, classified at the platform boundary: WebDeviceManager's getUserMedia/getDisplayMedia reject with a classified DeviceError, so platform error shapes never cross into the core. IDeviceManager gains the PlatformMediaStreamTrack/ PlatformMediaStream structural contracts (react-native-webrtc's tracks satisfy them; listener methods stay optional per FCE-3689) and tolerates mediaDevices without devicechange events. getAvailableMedia implements the audio-only/video-only fallback ladder with the Overconstrained retry, plus correctDevicesOnSafari label matching. mediaTypes carries the public middleware/init types (exported once the device API lands).
MiloszFilimowski
force-pushed
the
tsunami/04-device-foundation
branch
from
August 5, 2026 15:05
694bd11 to
dfa2e2c
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.
Description
devices/errors.ts:DeviceErrorclasses with the legacy name literals (NotAllowedError/NotFoundError/OverconstrainedError/UNHANDLED_ERROR), recoverability, and the platform cause. Classification happens at the platform boundary:WebDeviceManager.getUserMedia/getDisplayMediareject with a classifiedDeviceError, so raw platform error shapes never cross into the core.IDeviceManagergains thePlatformMediaStreamTrack/PlatformMediaStreamstructural contracts — the core no longer types against DOM media, and react-native-webrtc's runtime objects satisfy them (listener methods stay optional per FCE-3689).onDeviceChangefeature-detectsmediaDeviceswithout devicechange events (React Native's polyfill).devices/mediaInitializer.ts:getAvailableMediafallback ladder (audio-only / video-only on failure, Overconstrained retry with stripped deviceId) +recoverPersistedDevices— the platform contract states device ids are NOT stable across sessions, so a persisted device that resolves to nothing is re-matched by label and re-acquired with exact ids (no browser knowledge in the core).mediaTypes.ts: the public middleware/initialization types. Exported once the device API lands (next PRs in the stack).Motivation and Context
Foundation layer for porting device logic out of react-client: typed errors per the FCE-3580 error model, and a platform boundary that keeps the core free of
navigator.mediaDevicesand DOM media types.Documentation impact
Types of changes
not work as expected)