fix: Bug - In direct voice call the status is displayed as offline
Resolve direct-call participant join state and DM peer status across user identity aliases so call UI no longer shows participants as disconnected when they are in the call. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
||||
} from '../../../../infrastructure/mobile';
|
||||
import { initializeAppI18nForTests, provideAppI18nForTests } from '../../../../core/i18n/app-i18n.testing';
|
||||
import { ViewportService } from '../../../../core/platform';
|
||||
import { RealtimeSessionFacade } from '../../../../core/realtime';
|
||||
import {
|
||||
VoiceActivityService,
|
||||
VoiceConnectionFacade,
|
||||
@@ -109,6 +110,47 @@ describe('DirectCallService', () => {
|
||||
expect(context.directMessages.createGroupConversation).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('marks a remote join against the session participant alias stored locally', async () => {
|
||||
const aliceForeign = createUser('alice-foreign', 'Alice');
|
||||
const bobForeign = createUser('bob-foreign', 'Bob');
|
||||
const bobHome = { ...bobForeign, id: 'bob-home', oderId: 'bob-home' };
|
||||
const context = createServiceContext({ currentUser: aliceForeign, allUsers: [aliceForeign, bobForeign] });
|
||||
|
||||
context.directCallEvents.next({
|
||||
type: 'direct-call',
|
||||
directCall: {
|
||||
action: 'ring',
|
||||
callId: 'dm-alice-foreign--bob-foreign',
|
||||
conversationId: 'dm-alice-foreign--bob-foreign',
|
||||
createdAt: 10,
|
||||
sender: toParticipant(bobForeign),
|
||||
participantIds: ['alice-foreign', 'bob-foreign'],
|
||||
participants: [toParticipant(aliceForeign), toParticipant(bobForeign)]
|
||||
}
|
||||
});
|
||||
|
||||
await vi.waitFor(() => expect(context.service.sessionById('dm-alice-foreign--bob-foreign')).not.toBeNull());
|
||||
|
||||
context.directCallEvents.next({
|
||||
type: 'direct-call',
|
||||
directCall: {
|
||||
action: 'join',
|
||||
callId: 'dm-alice-foreign--bob-foreign',
|
||||
conversationId: 'dm-alice-foreign--bob-foreign',
|
||||
createdAt: 10,
|
||||
sender: toParticipant(bobHome),
|
||||
participantIds: ['alice-foreign', 'bob-foreign'],
|
||||
participants: [toParticipant(aliceForeign), toParticipant(bobForeign)]
|
||||
}
|
||||
});
|
||||
|
||||
await vi.waitFor(() => {
|
||||
const session = context.service.sessionById('dm-alice-foreign--bob-foreign');
|
||||
|
||||
expect(session?.participants['bob-foreign']?.joined).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
it('answers an incoming call from the modal action', async () => {
|
||||
const context = createServiceContext({ currentUser: bob, allUsers: [alice, bob] });
|
||||
|
||||
@@ -573,9 +615,17 @@ function createServiceContext(options: ServiceContextOptions): ServiceContext {
|
||||
{
|
||||
provide: MobileMediaService,
|
||||
useValue: {
|
||||
ensureVoiceCapturePermissions: vi.fn(async () => true),
|
||||
setSpeakerphoneEnabled: vi.fn(async () => undefined)
|
||||
}
|
||||
},
|
||||
{
|
||||
provide: RealtimeSessionFacade,
|
||||
useValue: {
|
||||
getClientInstanceId: vi.fn(() => 'test-client'),
|
||||
requestVoiceClientTakeover: vi.fn()
|
||||
}
|
||||
},
|
||||
...provideAppI18nForTests()
|
||||
]
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user