Skip to content

fix: update ongoing call in plugin on cold start - #334

Merged
cybex-dev merged 5 commits into
masterfrom
feat/restore_call_on_start
Aug 6, 2026
Merged

fix: update ongoing call in plugin on cold start#334
cybex-dev merged 5 commits into
masterfrom
feat/restore_call_on_start

Conversation

@cybex-dev

@cybex-dev cybex-dev commented Aug 6, 2026

Copy link
Copy Markdown
Owner

This pull request addresses a longstanding issue with the synchronization of call state between the native layers and Dart, ensuring that the activeCall object and isOnCall flag 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

  • When the Dart event listener attaches, if no call state event was buffered, the native layer emits the current call state (activeCall and isOnCall) 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]
  • Call state events are now recognized by specific prefixes, and the event buffer will remove any previously buffered call state events before adding a new one, preventing stale or duplicate state. [1] [2] [3] [4] [5] [6]

Event Buffering and Delivery

  • All platforms implement a bounded event buffer (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

  • The iOS and macOS implementations now properly track and emit custom call parameters as part of the call state event, ensuring Dart receives all relevant call metadata. [1] [2] [3] [4] [5]

Changelog Update

  • The CHANGELOG.md documents 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.

@cybex-dev cybex-dev self-assigned this Aug 6, 2026
@cybex-dev cybex-dev added Android bug Something isn't working iOS macOS labels Aug 6, 2026
@cybex-dev
cybex-dev marked this pull request as ready for review August 6, 2026 17:44
@cybex-dev
cybex-dev merged commit 79884ba into master Aug 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Android bug Something isn't working iOS macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant