fix: update ongoing call in plugin on cold start - #334
Merged
Conversation
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.
This pull request addresses a longstanding issue with the synchronization of call state between the native layers and Dart, ensuring that the
activeCallobject andisOnCallflag are always accurate when launching the app with an ongoing call. It introduces robust event buffering and replay mechanisms for Android, iOS, and macOS, so that the Dart side receives the correct call state even if the listener attaches after a call is already in progress. Additionally, the event buffer is now bounded to prevent unbounded memory growth.The most important changes are:
Call State Synchronization and Event Replay
activeCallandisOnCall) to ensure Dart is immediately up-to-date, even if the app was launched or resumed during an ongoing call. This applies to Android, iOS, and macOS. [1] [2] [3] [4]Event Buffering and Delivery
pendingEvents) for events raised before the Dart listener attaches, ensuring no events are lost and preventing unbounded growth. Buffered events are flushed to Dart when the listener attaches. [1] [2] [3] [4] [5] [6] [7]Custom Parameter Handling
Changelog Update
CHANGELOG.mddocuments the fix for call state synchronization across Android, iOS, and macOS, referencing the related GitHub issue.These changes collectively ensure reliable and accurate call state reporting to Dart, even in edge cases such as app cold starts, backgrounding, or late event listener attachment.