Skip to content

Commit e99338a

Browse files
authored
fix for the edge case (#1009)
1 parent 55c46c3 commit e99338a

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

packages/stream_video/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
🐞 Fixed
88
* Improved SFU error handling in Call flow and disconnect reason handling. The disconnected call state now accurately reflects the original cause of disconnection.
99
* Fixed an issue where rejecting a ringing call by one participant would incorrectly end the call for all other ringing participants.
10+
* Fixed an edge case where a call with the same CID as an incoming call is also an outgoing call to ensure the same Call instance is used.
1011

1112
## 0.9.6
1213

packages/stream_video/lib/src/stream_video.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,15 @@ class StreamVideo extends Disposable {
453453
event.metadata.details.createdBy.id != currentUserId &&
454454
event.data.ringing) {
455455
_logger.v(() => '[onCoordinatorEvent] onCallRinging: ${event.data}');
456+
457+
// In a edge case where call with the same CID as the incoming call is also an outgoing call
458+
// we want to use the same Call instance.
459+
if (state.outgoingCall.valueOrNull?.callCid.value ==
460+
event.data.callCid.value) {
461+
_state.incomingCall.value = state.outgoingCall.valueOrNull;
462+
return;
463+
}
464+
456465
final call = _makeCallFromRinging(data: event.data);
457466
_state.incomingCall.value = call;
458467
} else if (event is CoordinatorConnectedEvent) {

packages/stream_video_flutter/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ By (only) using these callbacks the root widgets will use more efficient partial
2020
🐞 Fixed
2121
* Improved SFU error handling in Call flow and disconnect reason handling. The disconnected call state now accurately reflects the original cause of disconnection.
2222
* Fixed an issue where rejecting a ringing call by one participant would incorrectly end the call for all other ringing participants.
23+
* Fixed an edge case where a call with the same CID as an incoming call is also an outgoing call to ensure the same Call instance is used.
2324

2425
## 0.9.6
2526

0 commit comments

Comments
 (0)