Background
The signaling server emits a MissedCallEvent (with caller and optional callerDisplayName) but the push isolate (PushNotificationIsolateManager) does not handle it. Instead, missed-call state is reconstructed by inferring it from a HangupEvent combined with the absence of an answered call.
Problem
The current approach relies on two timing-sensitive data sources:
IncomingCallEvent.caller — only available if the push isolate connected before the event passed through the hub. In late-connect scenarios the event is already gone.
_metadata.handle.value (FCM push payload) — reliable for the phone number, but carries no display name if the server did not include one in the push payload.
This fragile fallback chain was the root cause of WT-1416 (missed call showing "Unknown"). A partial fix was applied in PR #1203, but the underlying architecture remains fragile.
Proposed Solution
Add a MissedCallEvent handler in PushNotificationIsolateManager:
// packages/webtrit_signaling/lib/src/events/call/missed_call_event.dart
// Already exists — no changes needed
class MissedCallEvent extends CallEvent {
final String callee;
final String caller; // reliable phone number
final String? callerDisplayName; // optional display name
}
// lib/features/call/services/isolate_manager.dart
case MissedCallEvent():
_onHangupCall(syntheticHangupFrom(event), (
direction: CallDirection.incoming,
number: event.caller,
username: event.callerDisplayName,
...
));
By consuming MissedCallEvent directly the isolate gets authoritative caller data from the server instead of reconstructing it from race-prone state.
Expected Outcome
caller always contains the real phone number
callerDisplayName contains the display name when the server provides it
- Eliminates the race condition between
IncomingCallEvent and HangupEvent
- Simplifies
_getDisplayNameForMissedCall() fallback chain
Scope
lib/features/call/services/isolate_manager.dart — add MissedCallEvent case in _onProtocolEvent
- Verify the server actually sends
MissedCallEvent in all missed-call scenarios (may need server-side confirmation)
Related
Background
The signaling server emits a
MissedCallEvent(withcallerand optionalcallerDisplayName) but the push isolate (PushNotificationIsolateManager) does not handle it. Instead, missed-call state is reconstructed by inferring it from aHangupEventcombined with the absence of an answered call.Problem
The current approach relies on two timing-sensitive data sources:
IncomingCallEvent.caller— only available if the push isolate connected before the event passed through the hub. In late-connect scenarios the event is already gone._metadata.handle.value(FCM push payload) — reliable for the phone number, but carries no display name if the server did not include one in the push payload.This fragile fallback chain was the root cause of WT-1416 (missed call showing "Unknown"). A partial fix was applied in PR #1203, but the underlying architecture remains fragile.
Proposed Solution
Add a
MissedCallEventhandler inPushNotificationIsolateManager:By consuming
MissedCallEventdirectly the isolate gets authoritative caller data from the server instead of reconstructing it from race-prone state.Expected Outcome
calleralways contains the real phone numbercallerDisplayNamecontains the display name when the server provides itIncomingCallEventandHangupEvent_getDisplayNameForMissedCall()fallback chainScope
lib/features/call/services/isolate_manager.dart— addMissedCallEventcase in_onProtocolEventMissedCallEventin all missed-call scenarios (may need server-side confirmation)Related