feat(video_calls): android repeated call after hanging up fix and ios repeated calls after call initiation fix

This commit is contained in:
misha
2026-10-16 15:40:41 +03:00
parent 6d2935400a
commit 86e9d0cc31
14 changed files with 309 additions and 30 deletions

View File

@@ -74,7 +74,7 @@ void main() {
expect(shown.single.ios?.configureAudioSession, isFalse);
expect(shown.single.ios?.audioSessionActive, isFalse);
expect(shown.single.ios?.audioSessionMode, 'videoChat');
expect(shown.single.ios?.ringtonePath, 'system_ringtone_default');
expect(shown.single.ios?.ringtonePath, isNull);
});
test('iOS stops polling when the push claims the call', () async {
@@ -122,6 +122,25 @@ void main() {
expect(shown, isEmpty);
});
test('Android does not open a second CallKit UI', () async {
final shown = <CallKitParams>[];
final native = <VideoCallPushPayload>[];
await VideoCallIncomingPushPresenter.showIncomingCall(
payload,
isIos: false,
showAndroidIncoming: (incoming) async {
native.add(incoming);
},
showCallkitIncoming: (params) async {
shown.add(params);
},
);
expect(shown, isEmpty);
expect(native, [payload]);
});
test(
'Android shows the incoming call without waiting for a VoIP claim',
() async {

View File

@@ -96,6 +96,71 @@ void main() {
);
});
test('a decline just after leaving does not report the end again', () {
final leftAt = DateTime(2026, 10, 16, 12);
expect(
incomingDeclineShouldNotifyBackend(
leftAt: leftAt,
now: leftAt.add(const Duration(seconds: 5)),
),
isFalse,
);
expect(
incomingDeclineShouldNotifyBackend(
leftAt: leftAt,
now: leftAt.add(incomingDeclineNotifySuppression),
),
isTrue,
);
expect(
incomingDeclineShouldNotifyBackend(leftAt: null, now: leftAt),
isTrue,
);
});
test('a token is not requested again right after leaving', () {
final leftAt = DateTime(2026, 10, 16, 12);
expect(
mayRequestParticipantToken(
sessionPermitted: false,
leftAt: leftAt,
now: leftAt.add(const Duration(seconds: 2)),
),
isFalse,
);
expect(
mayRequestParticipantToken(
sessionPermitted: true,
leftAt: leftAt,
now: leftAt.add(const Duration(seconds: 2)),
),
isTrue,
);
expect(
mayRequestParticipantToken(
sessionPermitted: false,
leftAt: null,
now: leftAt,
),
isTrue,
);
});
test(
'an ended VoIP push is marked so its CallKit close is not a decline',
() {
expect(
callKitExtraMarksEndedPush(<String, dynamic>{'endedPush': true}),
isTrue,
);
expect(
callKitExtraMarksEndedPush(<String, dynamic>{'endedPush': 'true'}),
isTrue,
);
expect(callKitExtraMarksEndedPush(<String, dynamic>{}), isFalse);
},
);
test('keeps a connection-loss screen when the link drops', () {
expect(
shouldForceEndCallAfterRoomDisconnect(