Skip to content

Conversation

@rahul-lohra
Copy link
Contributor

@rahul-lohra rahul-lohra commented Feb 3, 2026

WIP

Goal

  1. Allow a Call instance to be safely re-joined after call.leave()
  2. Split the Call class into clear, single-purpose responsibilities

Expected Behavior

call.leave()  // Returns immediately, cleanup starts in background
call.leave() // should await for previous cleanup. And If cleanup is already done then skip it
call.join()   // Waits for cleanup, then joins ✅

call.leave()  // Returns immediately, cleanup starts in background  
call.join()   // Waits for cleanup, then joins ✅

call.leave()  // Returns immediately, cleanup completes
// No more joins, Call is cleaned up ✅

Implementation

Safe Re-join After call.leave()

  1. Cleanup triggered via call.leave() is serialized:
    • If a cleanup is already in progress, subsequent leave() calls wait for it.
    • If cleanup is already completed, repeated leave() calls are no-ops.
  • call.join() always waits for cleanup to complete before proceeding.
  • Call-scoped coroutines are re-initialized only during call.join(), and only after cleanup has finished.

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:

  1. CallApiDelegate
  2. CallEventManager
  3. CallLifecycleManager
  4. CallSessionManager
  5. CallConnectivityMonitor
  6. CallIceConnectionMonitor
  7. CallJoinCoordinator
  8. CallNetworkSubscriptionController
  9. CallReInitializer
  10. CallRenderer
  11. CallMediaManager
  12. CallRenderer
  13. CallStatsReporter

@rahul-lohra rahul-lohra changed the title Make call reusable after leave - 3 [WIP]Make call reusable after leave - 3 Feb 3, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

PR checklist ❌

The following issues were detected:

  • Missing required label: at least one label starting with pr:.
  • Section Goal is missing or empty.
  • Section Implementation is missing or empty.
  • Section Testing is missing or empty.

What we check

  1. Title is concise (5–18 words) unless labeled pr:ignore-for-release.
  2. At least one pr: label exists (e.g., pr:bug, pr:new-feature).
  3. Sections ### Goal, ### Implementation, and ### Testing contain content.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

SDK Size Comparison 📏

SDK Before After Difference Status
stream-video-android-core 11.96 MB 11.99 MB 0.03 MB 🟢
stream-video-android-ui-xml 5.68 MB 5.68 MB 0.00 MB 🟢
stream-video-android-ui-compose 6.27 MB 6.27 MB 0.00 MB 🟢

@rahul-lohra rahul-lohra self-assigned this Feb 3, 2026
# Things to fix
1. Self preview is stuck after join->fastReconnect()->leave()->join->fastReconnect()
# Things to test
1. Rejoin
2. Migrate
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.

1 participant