fix: session status stuck on Connection in progress on devices without GMS#1092
Merged
Conversation
On devices without Google Mobile Services (e.g. Huawei), PushTokensBloc never emits after initialization because GMS availability check returns a terminal status and aborts token retrieval without emitting any state. As a result, _lastPushTokensState remained null indefinitely, causing the condition `pushTokens != null && call != null` in _emitCombinedStatus to never pass — so the UI was stuck at SessionStatus.inProgress regardless of the actual signaling/registration state. Fix: seed _lastPushTokensState and _lastCallState from the blocs' initial states in the constructor, so subsequent _onCallChanged callbacks can emit the correct status even when PushTokensBloc never emits.
Member
Author
|
Addressed: removed the unused optional parameters |
digiboridev
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
On devices without Google Mobile Services (e.g. Huawei MAO-LX9N Android 12), the app shows "Connection in progress" permanently, even though the signaling connection and SIP registration complete successfully.
Root cause (two-part):
PushTokensBlocnever emits after initialization on no-GMS devices —_retrieveAndStoreFcmTokenchecks GMS availability, gets a terminal status, and returns early without anyemit()oradd().SessionStatusCubitconstructor called_emitCombinedStatus(pushTokensBloc.state, callBloc.state)passing initial states as parameters, but never stored them in_lastPushTokensState/_lastCallState. All subsequent calls from_onCallChangedused_lastPushTokensState = null, so the conditionpushTokens != null && call != nullwas alwaysfalse— the UI status was never updated from its initialSessionStatus.inProgress.On GMS devices this goes unnoticed because
PushTokensBlocemits when the FCM token arrives, which triggers_onPushTokensChanged, seeds_lastPushTokensState, and unblocks future_onCallChangedemissions.Fix
Seed
_lastPushTokensStateand_lastCallStatedirectly from the blocs' current states in the constructor, before subscribing to their streams.This way, even if
PushTokensBlocnever emits (no GMS),_onCallChangedcan still update the UI status correctly.Affected devices
Reproduces on any Android device without Google Play Services where
PushTokensBlocstays in its initial state (pushToken: null, errorMessage: null).Confirmed via logcat:
HUAWEI-MAO-LX9N-Android-12_2026-04-10_120728.logcat— signaling reachesregisteredat 12:07:02 but_lastPushTokensStateisnullthroughout the entire session.