mattermost-mobile-upstream/app/products/calls/connection
Bill Gardner 827eae876c
[MM-70525] Fix CallKit call disconnect on lock-screen answer (#10111)
* [MM-70525] Fix CallKit call disconnect on lock-screen answer

NativeCallMapping gains an optional callId field. When a VoIP push
arrives the mapping is created with callId seeded from calls state
(empty string if call_started hasn't been processed yet). handleCallStarted
backfills the callId once the WebSocket event confirms the call is live.

getNativeCallUUIDForCall now accepts an optional callId: when provided,
a mapping whose callId is empty or mismatched is treated as unconfirmed
and returns undefined, making endNativeCall a no-op. This prevents a
buffered call_end event from a prior call being replayed on WebSocket
reconnect from tearing down the active CallKit session.

handleCallEnded reads the callId from calls state before callEnded()
removes it, then passes it through to endNativeCall so the guard can
distinguish the current call from a stale replayed event.

* [MM-70525] Add handler-level tests for callId backfill and stale replay guard

Tests handleCallStarted backfilling callId into an existing native mapping
(VoIP-push-first ordering), handleCallEnded reading callId from state before
callEnded() clears it, and the stale call_end replay path where no active call
is in state.

* [MM-70525] Tighten callId ordering test: callEnded mock clears state

Makes the callEnded mock simulate state cleanup so the test fails if
callId is read after callEnded() rather than before it.
2026-09-08 14:17:56 -04:00
..
connection.test.ts replace react-native-incall-manager with @mattermost/calls-native for audio management (#9973) 2026-08-06 07:38:54 +08:00
connection.ts [MM-69735] Improve DM call user experience (#10017) 2026-09-03 19:44:10 +00:00
foreground_service.ts Receive Mattermost Calls through iOS native incoming-call UI (#9780) 2026-06-16 12:08:14 -03:00
websocket_client.test.ts Migrate calls WebSocket to URLSession for TLS 1.3 support on iOS (#9622) 2026-04-01 08:45:25 -04:00
websocket_client.ts fix: app bugs surfaced by Detox RF migration (#9789) 2026-06-09 13:25:42 +05:30
websocket_event_handlers.test.ts [MM-70525] Fix CallKit call disconnect on lock-screen answer (#10111) 2026-09-08 14:17:56 -04:00
websocket_event_handlers.ts [MM-70525] Fix CallKit call disconnect on lock-screen answer (#10111) 2026-09-08 14:17:56 -04:00