Skip to content

fix: parse rid and ssrc to proper types #67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Yash-Garg
Copy link

@Yash-Garg Yash-Garg commented Aug 12, 2025

This caused an issue on Safari where tracks were not being published properly due to rid being 0 and getting parsed as an int rather than a String.

Tested on Safari, Chrome & Firefox.

[Error] TypeError: 0: type 'int' is not a subtype of type 'String?'
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 215:26  DartError
dart-sdk/lib/_internal/js_dev_runtime/private/profile.dart 117:39             throw_
dart-sdk/lib/_internal/js_dev_runtime/private/profile.dart 117:39             _asStringQ
package:dart_webrtc/src/rtc_rtp_parameters_impl.dart.js 121:2204              fromJsObject
package:dart_webrtc/src/rtc_rtp_parameters_impl.dart.js 51:74                 <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/js_array.dart 219:8             <fn>
package:dart_webrtc/src/rtc_rtp_parameters_impl.dart.js 50:26                 encodingsFromJsObject
package:dart_webrtc/src/rtc_rtp_parameters_impl.dart.js 36:480                fromJsObject
package:livekit_client/src/widgets/video_track_renderer.dart.js 10532:72      LocalVideoTrackExt$124setDegradationPreference
package:livekit_client/src/widgets/video_track_renderer.dart.js 5128:79       <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 622:19           <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 647:23           <fn>
dart-sdk/lib/async/future_impl.dart 951:44                                    handleValueCallback
dart-sdk/lib/async/future_impl.dart 980:32                                    _propagateToListeners
dart-sdk/lib/async/future_impl.dart 723:5                                     <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 503:7            complete
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 570:12           _asyncReturn
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 622:19           <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 647:23           <fn>
dart-sdk/lib/async/future_impl.dart 951:44                                    handleValueCallback
dart-sdk/lib/async/future_impl.dart 980:32                                    _propagateToListeners
dart-sdk/lib/async/future_impl.dart 723:5                                     <fn>
dart-sdk/lib/async/future_impl.dart 807:7                                     <fn>
dart-sdk/lib/async/schedule_microtask.dart 40:11                              _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5                               _startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 186:15           <fn>

This caused a TypeError on Safari where rid was "0" and being parsed as
an integer instead of a string.
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