Make call reusable after leave - 2 #1606
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Goal
call.leave()Expected Behavior
Implementation
Safe Re-join After call.leave()
This guarantees deterministic behavior across:
• leave → leave → join
• leave → join
• repeated leave calls
Call Refactor
The Call class has been decomposed into the following focused components:
Each class now has clear ownership and a single reason to change.
Responsibility breakdown
1. CallApiDelegate
Methods
2. CallEventManager
Methods
3. CallCleanupManager
Methods
4. CallSessionManager
- Owns RTC session creation and lifecycle mechanics.
Methods
5. CallConnectivityMonitor
- Observes network connectivity changes and emits connectivity signals.
6. CallIceConnectionMonitor
- Monitors ICE connection state and manages ICE-level recovery.
Methods
7. CallJoinCoordinator
- Owns join / rejoin orchestration and retry semantics.
Methods
9. CallNetworkSubscriptionController
- Manages subscription and unsubscription to network state providers.
10. CallReInitializer
- Re-initializes call-scoped coroutines after cleanup.
Methods
11. CallRenderer
- Manages video renderer.
Methods
12. CallMediaManager
- Manages camera, microphone, speaker, and media configuration.
Methods
13. CallStatsReporter
- Handles call statistics collection and reporting.
Methods
🎨 UI Changes
None
Testing
To be updated, will provide patch which will comment out destroying calls logic
Provide the patch summary here