fix(llc): fix stream header client details#1262
Conversation
|
Warning Review limit reached
More reviews will be available in 38 minutes and 58 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughIntroduces a VideoEnvironment model and manager refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/stream_video/lib/src/stream_video.dart`:
- Around line 237-257: The manual connect path in StreamVideo can still run
before _collectEnvironment() finishes, so the SDK may use stale defaults from
videoEnvironmentManager in globals.dart. Add a shared initialization future (for
example, _environmentReady) that is completed after _updateVideoEnvironment()
runs, and make connect() await it before building headers/client details so both
autoConnect and manual connect see the populated environment.
In `@packages/stream_video/lib/src/video_environment.dart`:
- Around line 38-63: The VideoEnvironment.copyWith method cannot clear optional
fields because every parameter uses null-coalescing to fall back to the existing
value. Update copyWith so callers can explicitly set fields like appName,
browserName, deviceModel, and the other optional metadata fields to null when
needed, while still preserving old values only when no override is provided. Use
VideoEnvironment.copyWith and the affected fields in the constructor call to
implement a nullable-aware pattern that distinguishes “not passed” from “passed
null.”
🪄 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: 75d6615e-5eba-4ac5-8a06-878acf1bfbc9
📒 Files selected for processing (4)
packages/stream_video/lib/globals.dartpackages/stream_video/lib/src/stream_video.dartpackages/stream_video/lib/src/video_environment.dartpackages/stream_video/lib/src/video_environment_manager.dart
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1262 +/- ##
========================================
+ Coverage 9.71% 9.78% +0.07%
========================================
Files 676 678 +2
Lines 49695 49732 +37
========================================
+ Hits 4826 4866 +40
+ Misses 44869 44866 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| () => | ||
| '[StreamVideo] failed to set client details: $error with stackTrace: $stackTrace', | ||
| ); | ||
| _collectEnvironment().then((env) { |
There was a problem hiding this comment.
not sure, but can you make sure we get the .then callback and calls connect even if the _collectEnvironment throws?
There was a problem hiding this comment.
maybe better to add a test for this
Summary by CodeRabbit
New Features
Bug Fixes