fix: integers not properly casted in WASM builds#1216
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughMultiple Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/stream_video/lib/src/webrtc/rtc_manager.dart`:
- Around line 1642-1651: The type guards for settings['width'] and
settings['height'] currently use `is int`, which skips values like 1280.0 on
WASM; change those checks to `is num` so both int and double values are
accepted, ensuring the code enters the dimension.copyWith(...) branches and the
(settings['...'] as num).toInt() conversion is executed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e40e7241-9ffc-47ab-abd5-f70f1f6436b5
📒 Files selected for processing (15)
packages/stream_video/lib/src/coordinator/open_api/event/health_check.dartpackages/stream_video/lib/src/webrtc/model/stats/rtc_codec.dartpackages/stream_video/lib/src/webrtc/model/stats/rtc_ice_candidate.dartpackages/stream_video/lib/src/webrtc/model/stats/rtc_ice_candidate_pair.dartpackages/stream_video/lib/src/webrtc/model/stats/rtc_inbound_rtp_audio_stream.dartpackages/stream_video/lib/src/webrtc/model/stats/rtc_inbound_rtp_video_stream.dartpackages/stream_video/lib/src/webrtc/model/stats/rtc_media_stream_track_local_video.dartpackages/stream_video/lib/src/webrtc/model/stats/rtc_media_stream_track_receiver_audio.dartpackages/stream_video/lib/src/webrtc/model/stats/rtc_media_stream_track_remote_video.dartpackages/stream_video/lib/src/webrtc/model/stats/rtc_outbound_rtp_audio_stream.dartpackages/stream_video/lib/src/webrtc/model/stats/rtc_outbound_rtp_video_stream.dartpackages/stream_video/lib/src/webrtc/model/stats/rtc_remote_inbound_rtp_audio_stream.dartpackages/stream_video/lib/src/webrtc/model/stats/rtc_remote_inbound_rtp_video_stream.dartpackages/stream_video/lib/src/webrtc/model/stats/rtc_video_source.dartpackages/stream_video/lib/src/webrtc/rtc_manager.dart
|
@Brazol let me know if any changes are required :) |
🎯 Goal
Cast dynamic values to
numfirst before casting them tointto avoid below error:See flutter/flutter#159400
🛠 Implementation details
Update all dynamic values implicitly casted to
int?as:🎨 UI Changes
Add relevant screenshots
Add relevant videos
🧪 Testing
Run the example app and watch sea of type casting errors in browser's console. Use the updated code and see no errors are printed (aside from type casting errors in
dart_webrtc)Provide a patch below if it is necessary for testing
Provide the patch summary here
☑️Contributor Checklist
General
☑️Reviewer Checklist
Summary by CodeRabbit