Conversation
…utation queue deadlock __onMutationPerformAnswer (sequential mutation queue) awaits stream.firstWhere(incomingOffer != null) while holding the queue slot. __onMutationSignalingIncoming — which stores the offer and line in state — is queued behind it and cannot run: deadlock, resolved only by 10 s timeout. Fix: in __onCallSignalingEventIncoming (_CallSignalingEvent queue, independent of the mutation queue), emit offer and line directly to BLoC state when the call is in a push-answer waiting status and has no offer yet. This immediately satisfies stream.firstWhere without touching the mutation queue and ensures AcceptRequest is sent with the correct SIP line.
e93643e to
f115b3a
Compare
digiboridev
approved these changes
Apr 30, 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
When answering an incoming push call (kill-on-background enabled), the call gets stuck in
preparingstate and drops after ~10 seconds.Root cause:
__onMutationPerformAnswerholds the sequential mutation queue slot while awaitingstream.firstWhere(incomingOffer != null).__onMutationSignalingIncoming(which stores the offer in state) is queued behind it — deadlock that ends in a 10 s timeout.Fix
__onCallSignalingEventIncomingruns in the independent_CallSignalingEventqueue. When an offer arrives for a call that is already inincomingFromPush,incomingSubmittedAnswer, orincomingPerformingStartedwith no offer yet, emit bothincomingOfferandlinedirectly to BLoC state. This unblocksstream.firstWhereimmediately without waiting for the mutation queue.__onMutationSignalingIncomingstill runs afterwards and re-sets the same values (harmless). ThecanPerformAnswerguard drops any duplicateCallControlEvent.answeredsafely.Related
markAnswered()not called whenflutterApi == null, causingHandshakeProcessorto sendDeclineRequestfor a deliberately answered call.