Skip to content

feat: allow multiple simultaneous active calls #977

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

Merged
merged 11 commits into from
Jun 4, 2025

Conversation

Brazol
Copy link
Contributor

@Brazol Brazol commented Jun 2, 2025

resolves FLU-158

🎯 Goal

Right now, our Video SDK only allows one active call at a time. We keep track of the active call in a state, and when a new call connects, we always end the previous one. We want to allow multiple active calls to happen in the same time as some clients have this requirement. This PR makes it possible.

🛠 Implementation details

  • By default, only a single active call is still permitted, as it was before. To change this behavior, allowMultipleActiveCalls has been added to StreamVideoOptions.
  • All places that relied on activeCall are adjusted to handle multiple active calls.
  • StreamBackgroundService is also adjusted, showing multiple notifications

@Brazol Brazol requested a review from a team as a code owner June 2, 2025 15:27
Copy link

codecov bot commented Jun 3, 2025

Codecov Report

Attention: Patch coverage is 18.78173% with 160 lines in your changes missing coverage. Please review.

Project coverage is 2.69%. Comparing base (fdf7a6d) to head (a88c84f).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...er/lib/src/call_background/background_service.dart 0.00% 104 Missing ⚠️
packages/stream_video/lib/src/stream_video.dart 28.20% 28 Missing ⚠️
...ckages/stream_video/lib/src/core/client_state.dart 70.00% 6 Missing ⚠️
...o_flutter/lib/stream_video_flutter_background.dart 0.00% 6 Missing ⚠️
...utter/lib/stream_video_flutter_method_channel.dart 0.00% 5 Missing ⚠️
packages/stream_video/lib/src/call/call.dart 66.66% 4 Missing ⚠️
...rc/call_background/model/notification_options.dart 0.00% 4 Missing ⚠️
...ontrols/controls/toggle_screen_sharing_option.dart 0.00% 2 Missing ⚠️
...stream_video/lib/src/models/disconnect_reason.dart 80.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main    #977      +/-   ##
========================================
+ Coverage   1.75%   2.69%   +0.93%     
========================================
  Files        571     571              
  Lines      38295   38358      +63     
========================================
+ Hits         673    1032     +359     
+ Misses     37622   37326     -296     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@renefloor renefloor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some comments about backwards compatibility.

client_state.dart is not exported from the library, but is accessible through StreamVideo.state, so it's technically part of the public API.

Not sure if we can completely prevent breaking changes, but I would really prefer to start limiting them whenever possible. Especially in this case, where preventing the breaking changes also makes it easier for most developers, as having multiple active calls isn't the main usecase of the libary.

@Brazol Brazol merged commit f82e7e3 into main Jun 4, 2025
10 checks passed
@Brazol Brazol deleted the feat/allow-multiple-active-calls branch June 4, 2025 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants