test: Add 8 people voice tests

This commit is contained in:
2026-04-18 14:19:59 +02:00
parent bd21568726
commit 167c45ba8d
17 changed files with 2044 additions and 232 deletions

View File

@@ -559,23 +559,32 @@ export class RoomsSidePanelComponent {
const current = this.currentUser();
if (this.openExistingVoiceWorkspace(room, current ?? null, roomId)) {
this.voiceConnection.clearConnectionError();
return;
}
if (!room || !this.canJoinRequestedVoiceRoom(room, current ?? null, roomId)) {
if (!room) {
this.voiceConnection.reportConnectionError('No active room selected for voice join.');
return;
}
if (!this.canJoinRequestedVoiceRoom(room, current ?? null, roomId)) {
this.voiceConnection.reportConnectionError('You do not have permission to join this voice channel.');
return;
}
if (!this.prepareCrossServerVoiceJoin(room, current ?? null)) {
this.voiceConnection.reportConnectionError('Disconnect from the current voice server before joining a different server.');
return;
}
this.enableVoiceForJoin(room, current ?? null, roomId)
.then(() => this.onVoiceJoinSucceeded(roomId, room, current ?? null))
.catch(() => undefined);
.catch((error) => this.handleVoiceJoinFailure(error));
}
private onVoiceJoinSucceeded(roomId: string, room: Room, current: User | null): void {
this.voiceConnection.clearConnectionError();
this.updateVoiceStateStore(roomId, room, current);
this.trackCurrentUserMic();
this.startVoiceHeartbeat(roomId, room);
@@ -583,6 +592,14 @@ export class RoomsSidePanelComponent {
this.startVoiceSession(roomId, room);
}
private handleVoiceJoinFailure(error: unknown): void {
const message = error instanceof Error
? error.message
: 'Failed to join voice channel.';
this.voiceConnection.reportConnectionError(message);
}
private trackCurrentUserMic(): void {
const userId = this.currentUser()?.oderId || this.currentUser()?.id;
const micStream = this.voiceConnection.getRawMicStream();