-
Notifications
You must be signed in to change notification settings - Fork 46
fix(ui): fixes call ringing on Android when app is in detached state #1161
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
Conversation
📝 WalkthroughWalkthroughAdds app lifecycle state to client state, records app lifecycle in StreamVideo, ensures one-time initialization of push-notification and audio-interruption observers in the dogfooding app, adds Android detached-state guards for accepting calls, and applies minor Android push-notification null-safety and lifecycle tweaks; changelogs updated. Changes
Sequence DiagramsequenceDiagram
participant App as App Lifecycle
participant StreamVideo as StreamVideo Client
participant ClientState as ClientState
participant CallHandler as Call Accept Handler
participant Android as Android Platform
App->>StreamVideo: _onAppState(newState)
StreamVideo->>ClientState: appLifecycleState.value = newState
Android->>StreamVideo: observeCallAcceptRingingEvent(event)
StreamVideo->>ClientState: read appLifecycleState
alt state == detached (Android)
ClientState-->>StreamVideo: detached
StreamVideo->>StreamVideo: skip _onCallAccept
else state != detached
ClientState-->>StreamVideo: not detached
StreamVideo->>CallHandler: _onCallAccept(event)
CallHandler->>Android: accept incoming call
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
.../getstream/video/flutter/stream_video_push_notification/StreamVideoPushNotificationPlugin.kt
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1161 +/- ##
=====================================
Coverage 6.47% 6.47%
=====================================
Files 601 601
Lines 42025 42030 +5
=====================================
+ Hits 2721 2722 +1
- Misses 39304 39308 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/stream_video/lib/src/core/client_state.dart (1)
97-104: ResetappLifecycleStateduringclear()to avoid stale detached state.
If the last value isdetached, a subsequent login could keep that value until the next lifecycle emission, potentially skipping accept handling. Consider nulling it on clear (Line 100).🛠️ Suggested fix
Future<void> clear() async { activeCalls.value = []; outgoingCall.value = null; + appLifecycleState.value = null; connection.value = ConnectionState.disconnected(user.value.id); }
resolves FLU-362
When back button is used to leave the app on Android the app enteres into a
detachedstate where the Flutter Activity is detached but Flutter engine is still running. This caused isses when handling ringing notifications and accepting the call from this state.Summary by CodeRabbit
New Features
Bug Fixes
Chores
✏️ Tip: You can customize this high-level summary in your review settings.