Skip to content

Conversation

@ipavlidakis
Copy link
Contributor

🔗 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.startCall with an empty members and ring = true array 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.members when its callingState = .outgoing and outgoingCallMembers.isEmpty.

🧪 Manual Testing Notes

  • Create a ringing group call (minimum 3 participants) from the cli where the iOS user will be the creator
  • Start the call then on iOS
  • Reject the call from one of the other participants
  • Call should continue ringing for everyone else

☑️ Contributor Checklist

  • I have signed the Stream CLA (required)
  • This change follows zero ⚠️ policy (required)
  • This change should receive manual QA
  • Changelog is updated with client-facing changes
  • New code is covered by unit tests
  • Comparison screenshots added for visual changes
  • Affected documentation updated (tutorial, CMS)
@ipavlidakis ipavlidakis self-assigned this Jul 24, 2025
@ipavlidakis ipavlidakis requested a review from a team as a code owner July 24, 2025 14:05
@ipavlidakis ipavlidakis added the bug Something isn't working label Jul 24, 2025
@github-actions
Copy link

Public Interface

🚀 No changes affecting the public interface.

@Stream-SDK-Bot
Copy link
Collaborator

Stream-SDK-Bot commented Jul 24, 2025

SDK Size

title develop branch diff status
StreamVideo 8.16 MB 8.16 MB 0 KB 🟢
StreamVideoSwiftUI 2.29 MB 2.29 MB +1 KB 🟢
StreamVideoUIKit 2.41 MB 2.41 MB 0 KB 🟢
StreamWebRTC 9.85 MB 9.85 MB 0 KB 🟢
Copy link

Copilot AI left a 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.members for 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 callMembersUpdates is not descriptive enough. Consider renaming it to outgoingCallMembersUpdates to 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 { 
@ipavlidakis ipavlidakis force-pushed the fix/callviewmodel-ending-call-when-one-other-participant-rejects-call branch from 52d4dc3 to b4d37b6 Compare July 25, 2025 08:37
@github-actions
Copy link

Public Interface

🚀 No changes affecting the public interface.

@ipavlidakis ipavlidakis merged commit 7d012ce into develop Jul 25, 2025
3 of 5 checks passed
@ipavlidakis ipavlidakis deleted the fix/callviewmodel-ending-call-when-one-other-participant-rejects-call branch July 25, 2025 10:31
@github-actions
Copy link

Public Interface

🚀 No changes affecting the public interface.

@Stream-SDK-Bot Stream-SDK-Bot mentioned this pull request Jul 25, 2025
@Stream-SDK-Bot Stream-SDK-Bot mentioned this pull request Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

5 participants