mattermost-mobile-upstream/app/init
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
..
app.ts perf: skip Android Keystore listing on cold start (#10056) 2026-08-27 10:58:22 +08:00
calls_native.test.ts [MM-70525] Fix CallKit call disconnect on lock-screen answer (#10111) 2026-09-08 14:17:56 -04:00
calls_native.ts [MM-70525] Fix CallKit call disconnect on lock-screen answer (#10111) 2026-09-08 14:17:56 -04:00
credentials.test.ts perf: skip Android Keystore listing on cold start (#10056) 2026-08-27 10:58:22 +08:00
credentials.ts perf: skip Android Keystore listing on cold start (#10056) 2026-08-27 10:58:22 +08:00
launch.test.ts Mm 68767 zero persistence (#9803) 2026-07-16 13:55:45 +02:00
launch.ts Fix deeplink handler (#9919) 2026-08-19 01:35:52 +08:00
managed_app.test.ts On iOS, resuming after the 5-minute window showed no biometric prompt — (#10102) 2026-09-02 15:03:13 +08:00
managed_app.ts On iOS, resuming after the 5-minute window showed no biometric prompt — (#10102) 2026-09-02 15:03:13 +08:00
push_notifications.test.ts Mm 68292 receive push wipe (#9822) 2026-06-25 10:42:30 +02:00
push_notifications.ts [MM-69457] Stop logging PII in exportable app logs (#9884) 2026-07-02 12:19:04 +02:00