fix: wait for callkit audio activation and then start audio engine, remove the previous timeout - #2328
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughCallKit audio configuration is applied synchronously while WebRTC engine availability is gated across activation states. React Native activation waiting is removed, audio-session and recording tracing is added, and WebRTC dependency versions and the Yarn allowlist are updated. ChangesCallKit audio lifecycle
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant CallKit
participant CallingxImpl
participant AudioSessionManager
participant AudioDeviceModule
participant WebRTC
CallKit->>CallingxImpl: Start or answer call action
CallingxImpl->>AudioDeviceModule: Disable engine availability
CallingxImpl->>AudioSessionManager: Apply CallKit configuration synchronously
CallKit->>CallingxImpl: Activate audio session
CallingxImpl->>AudioSessionManager: Reapply CallKit configuration
CallingxImpl->>AudioDeviceModule: Enable engine availability
CallingxImpl->>WebRTC: Notify activation
CallKit->>CallingxImpl: Deactivate audio session
CallingxImpl->>AudioDeviceModule: Disable engine availability
CallingxImpl->>WebRTC: Notify deactivation
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ 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 |
Bundle sizeBuilt package output. Sizes in KB; delta vs
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/react-native-sdk/src/hooks/push/useCallingExpWithCallingStateEffect.ts`:
- Around line 236-251: Wrap the native ADM calls inside traceRecordingState in a
try-catch, including isRecording, isEngineRunning, and isMicrophoneMuted. Handle
any thrown error by logging it through the existing logger and return without
allowing the diagnostics-only callback to propagate an exception; preserve the
current state trace and warning behavior when all calls succeed.
🪄 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 Plus
Run ID: 0019cfd5-3d9b-4b16-80e0-35f35cf501ab
⛔ Files ignored due to path filters (2)
sample-apps/react-native/dogfood/ios/Podfile.lockis excluded by!**/*.lockyarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (9)
.yarnrc.ymlpackages/react-native-callingx/ios/AudioSessionManager.swiftpackages/react-native-callingx/ios/CallingxImpl.swiftpackages/react-native-sdk/ios/StreamInCallManager.swiftpackages/react-native-sdk/src/hooks/push/useCallingExpWithCallingStateEffect.tspackages/react-native-sdk/src/utils/internal/callingx/audioSessionPromise.tspackages/react-native-sdk/src/utils/internal/callingx/callingx.tspackages/react-native-sdk/src/utils/push/setupCallingExpEvents.tssample-apps/react-native/dogfood/package.json
💤 Files with no reviewable changes (3)
- packages/react-native-sdk/src/utils/internal/callingx/audioSessionPromise.ts
- packages/react-native-sdk/src/utils/push/setupCallingExpEvents.ts
- packages/react-native-sdk/src/utils/internal/callingx/callingx.ts
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/video-filters-react-native/package.json (1)
51-51: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winAlign the peer dependency with the required WebRTC version.
Line 60 still allows
^145.0.0, including145.0.0, while the development dependency now targets145.1.0. If this package relies on the CallKit/audio fixes in 145.1.0, change the peer range to^145.1.0; otherwise, confirm why older WebRTC versions remain supported.🤖 Prompt for 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. In `@packages/video-filters-react-native/package.json` at line 51, Update the `@stream-io/react-native-webrtc` peer dependency range to ^145.1.0 so it matches the development dependency and requires the supported WebRTC fixes; do not retain compatibility with 145.0.0.
🤖 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.
Nitpick comments:
In `@packages/video-filters-react-native/package.json`:
- Line 51: Update the `@stream-io/react-native-webrtc` peer dependency range to
^145.1.0 so it matches the development dependency and requires the supported
WebRTC fixes; do not retain compatibility with 145.0.0.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: aa59eb64-d749-4c8e-81a4-cf3c2416e726
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (4)
packages/react-native-callingx/package.jsonpackages/react-native-sdk/package.jsonpackages/video-filters-react-native/package.jsonsample-apps/react-native/ringing-tutorial/package.json
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/react-native-sdk/package.json
💡 Overview
depends on GetStream/react-native-webrtc#53
Also:
Summary by CodeRabbit