Business · Product · Technology · AI

Handle call invitations with explicit deadlines, completion events and delivery outcomes

A Movo-X notification case covering caller labels versus payload fields, invitation expiry, ended-event correlation and worker reports, with three isolated transport fixtures.

Work directly with Omer Muneer Qazi · Reviewed 29 November 2026

The scenario: a call invitation arrives after its useful window

A call invitation has a short operating window. A device may reconnect after that window or continue showing a call after another device accepted it. The notification pipeline needs an invitation deadline, a correlated end event and clear outcomes for provider attempts. Otherwise a successful queue operation can be confused with a useful call invitation on the phone.

The reviewed Movo-X helpers construct call and ended payloads and process leased notification work. Three selected tests passed with synthetic targets and injected senders. No actual APNs/FCM request, phone call screen or media-room admission was exercised.

Review the caller label and data payload separately

The inspected caller-label helper uses the clinic and consultation mode without the doctor name. The incoming-call data payload intentionally contains selected clinic and doctor display names as well as the opaque consultation and ring identifiers. The selected fixture checks that exact distinction.

A restrained display label therefore does not make the full payload anonymous. The actual locked-screen presentation depends on the client using the intended fields and respecting its privacy design. This source review does not demonstrate that device behaviour. A field-level privacy acceptance should inspect the label, payload, logs and phone presentation independently.

Tie an invitation to its remaining lifetime

The inspected APNs constructor includes the ring’s expiration, and the FCM constructor derives its selected TTL from the remaining ring time. The worker helper refuses an already expired invitation before attempting its configured senders. The selected worker fixture checks that expired case.

Those are selected construction and dispatch properties. They do not establish when a real provider delivers a message or whether a phone acts on stale data correctly. The client should evaluate the accepted ring identity and current state under its own contract, and actual provider/device timing needs a separate synthetic integration run.

Keep the ending event correlated with the invitation

The ended payload retains the relevant ring/consultation identifiers and an accepted reason such as accepted, declined, missed or cancelled. Its provider construction uses the same selected correlation/collapse context as the invitation. The selected fixture checks the shared topic/key representation and refuses an unsupported reason.

That gives a device enough context to reconcile the intended invitation. It does not prove that provider collapsing always removes every older queued message or that a native call screen ends correctly. Verify the actual accepted-on-another-device, declined and timeout scenarios on the intended builds, including how an already active call treats its ending notification.

Allow an ending event to outlive the original invitation window

The reviewed ended-event helpers retain a minimum delivery window even when the original invitation time has passed. The selected test uses an expired invitation and checks that its ended message still has the configured minimum lifetime. That serves a different purpose from keeping an old invitation alive.

A late ending message can help clear a device that still believes it is ringing, while a late invitation can create a false prompt. Their lifetime policies therefore need independent definitions. The local fixture establishes the selected output values, not a live phone’s cleanup behaviour or a guarantee that an ending event will arrive.

Report provider attempts per target

The worker helper returns sent-target and invalid-target identifiers plus a selected aggregate outcome. Injected transient failures can produce retry, while invalid targets are recorded separately. With no usable providers, the selected fixture produces no fake successful delivery.

An aggregate sent outcome must be interpreted under that function’s definition; it is not a receipt that every phone rang or a person answered. The coordinating service needs to use the per-target result to manage later work. The tests supply mocked service responses, so actual target pruning, retry selection and duplicate handling remain separate acceptance.

Keep lease, attempt and completion as separate workflow stages

The inspected worker pass leases notification items, invokes the delivery helper and reports completion for each result. The selected fixture checks that order using a fake RPC and sender pair. It also checks a selected backoff distinction between an unsupported worker operation and an ordinary transient failure.

This is useful operating evidence about the worker’s local orchestration, not proof of database lease exclusivity or production configuration. A real handover should inspect competing workers, uncertain completion and provider outages with approved synthetic targets. A provider-accepted attempt also does not grant room access; the separate admission endpoint remains responsible for that decision.

A concrete invitation-delivery handover

Deliver the payload field map, caller-label policy, invitation/end lifetimes, correlation identity and per-target outcome contract. Attach expired invitation, late ending, invalid target, transient failure and absent-provider fixtures. Add real device presentation, provider receipt and authoritative lease/admission evidence separately.

For a CTO, this makes call delivery reviewable at the right stages. A timely invitation, a correlated ending, a provider attempt and room admission are distinct outcomes with different owners. The pinned source and three isolated tests support selected payload and worker decisions while phone behaviour, privacy presentation and actual call completion retain their independent verification.

Compare the reviewed boundaries

Selected notification facts require different evidence

On smaller screens, scroll across to compare every column. Keyboard users can focus the table and use the arrow keys.

SurfaceReviewed source/fixture resultSeparate acceptance
Caller labelClinic/mode label omits doctor nameActual native locked-screen presentation
Incoming-call dataContains selected clinic/doctor display namesPrivacy, logging and client-field handling
Invitation versus endingDifferent expiry purposes; correlated identifiersProvider timing and phone reconciliation
Worker completionReports selected per-target attempt outcomesPerson received/answered and room admission

Illustrative control flow

Pseudocode summarizing the decision boundary. It is not copied production code or a deployment instruction.

if invitation_is_expired():
    do_not_attempt_it_as_a_new_call()
else:
    report_per_target_provider_outcomes()

on_ending_event:
    send_correlated_terminal_state_under_its_own_lifetime()

authoritative_admission_remains_a_separate_workflow()
# A provider attempt is not a phone-ring, answered-call or admission receipt.

About this engineering series

Written by Omer Muneer Qazi from a review of Movo-X implementation and dated engineering records. This article explains source behaviour and historical observations; current production, clinical outcomes and store availability require their own verification. Examples are synthetic and proposed test cases are identified as such.

Explore the Movo-X engineering series → · Related implementation experience →

Discuss a similar engineering problem

Send the workflow, current platform and the decision your team needs to make. I can help define an implementation or review scope with concrete acceptance evidence.

Discuss your project on WhatsApp ↗
WhatsApp Omer about this project ↗