Recognise remote-cancellation pushes in managed PushKit mode - #11
Merged
Conversation
A payload whose descriptor isCancellation (built-in markers: type/event equal to cancel/cancelled/cancellation under data or at the top level) is no longer reported to CallKit as a new incoming call. It is routed to -handleCancelledIncomingCallWithUUID:reason:completion: with CXCallEndedReasonRemoteEnded instead — the incoming-call screen comes down, a call whose INVITE has not arrived is remembered so the late INVITE is answered 603, and a cancellation that overtook the announcement push leaves a tombstone that cannot ring. Hosts with a different marker shape return a descriptor whose cancellation flag is set from pushPayloadParser. Also deduplicates repeat announcement pushes in host-owned CallKit mode: a second push for a UUID that is already on the CallKit screen no longer re-publishes the incoming state or restarts the ring timeout. Adds CallWavePushCancellationTests covering cancel-before-INVITE, marker variants, the tombstone race, duplicate pushes and custom parser cancellations.
This was referenced Aug 6, 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.
What
SDK-managed PushKit (
CallWaveIntegrationOptionManagesVoIPPushRegistry) previously treated every VoIP push as a new incoming call. Cancellation payload detection existed only inIntercomDemo, which manually calledhandleCancelledIncomingCall. This PR moves cancellation detection into the SDK.Changes
CallWaveIncomingCallDescriptor: added theisCancellationflag and the+cancellationDescriptorWithUUID:factory method. The existing API remains unchanged.descriptorForPushPayload:now recognizes built-intype/eventmarkers with valuescancel/cancelled/cancellation(case-insensitive, either insidedataor at the top level). Hosts using a custom payload format can return a cancellation-marked descriptor frompushPayloadParser.handleVoIPPushPayload:completion:: cancellation payloads are never passed toreportNewIncomingCallWithUUID:. Instead, they are routed through the existinghandleCancelledIncomingCallWithUUID:reason:completion:path withCXCallEndedReasonRemoteEnded, including the tombstone case where the cancellation arrives before the announce push. The push completion handler is acknowledged exactly once throughCallWavePushCompletionGate.incomingevent or restarts the ring timeout.CallWaveClient.hhas been updated.Tests
Added
CallWavePushCancellationTestswith 6 cases: cancellation before INVITE, all supported cancellation markers, the tombstone race (cancel → late announce push does not ring), “cancellation never becomes a new incoming call,” duplicate push handling, and cancellation through a custom parser.iOS Simulator test run: 54 tests, 0 failures (
Scripts/run-package-tests.sh).Replaces #10 (that branch was based on the 0.3.1 line and conflicted with 0.4.x).