-
Notifications
You must be signed in to change notification settings - Fork 30
[Fix]CallViewModel ending outgoing group call when one of the participants rejects #901
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
[Fix]CallViewModel ending outgoing group call when one of the participants rejects #901
Conversation
Public Interface🚀 No changes affecting the public interface. |
SDK Size
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue where outgoing group calls would incorrectly end for all participants when just one participant rejects the call. The fix ensures that when calls are created externally (with empty members array), the CallViewModel properly observes call member updates to maintain accurate participant counts.
Key changes:
- Added observation of
CallState.membersfor externally created outgoing calls - Enhanced test infrastructure with MockDefaultAPI support
- Improved call rejection logic with descriptive reason messages
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| StreamVideoSwiftUI/CallViewModel.swift | Added member observation logic to fix premature call ending |
| StreamVideoTests/Mock/MockDefaultAPI.swift | Added getOrCreateCall mock method for test infrastructure |
| StreamVideoTests/Mock/MockCall.swift | Enhanced create method with proper error handling |
| StreamVideoSwiftUITests/CallViewModel_Tests.swift | Added comprehensive test for rejection scenario |
| StreamVideo.xcodeproj/project.pbxproj | Added MockDefaultAPI to test target sources |
Comments suppressed due to low confidence (2)
Sources/StreamVideoSwiftUI/CallViewModel.swift:70
- [nitpick] The variable name
callMembersUpdatesis not descriptive enough. Consider renaming it tooutgoingCallMembersUpdatesto clearly indicate it's specifically for tracking outgoing call member updates.
callMembersUpdates = call?
StreamVideoSwiftUITests/CallViewModel_Tests.swift:221
- [nitpick] The test function name is very long and could be more concise. Consider renaming to
test_outgoingCall_oneParticipantRejects_callContinues()for better readability.
func test_outgoingCall_callCreatedPriorToStarting_rejectedEventFromOneParticipantCallRemainsOngoing() async throws {
52d4dc3 to
b4d37b6
Compare
Public Interface🚀 No changes affecting the public interface. |
Public Interface🚀 No changes affecting the public interface. |
|



🔗 Issue Links
Resolves https://linear.app/stream/issue/IOS-1031/blinkios-ending-outgoing-group-call-when-one-of-the-participants
📝 Summary
In cases where the call is being created on the backend and the iOS device relies on it to set the call data correctly, by calling
CallViewModel.startCallwith an emptymembersandring = truearray then if the call is rejected by one of the participants then iOS mistakenly will end the call for everyone.🛠 Implementation
The CallViewModel now observes the
CallState.memberswhen itscallingState = .outgoingandoutgoingCallMembers.isEmpty.🧪 Manual Testing Notes
☑️ Contributor Checklist