fix: Fix multiple bugs with new authentication flow

This commit is contained in:
2026-06-07 15:04:21 +02:00
parent 9fc26b1ccf
commit 83456c018c
137 changed files with 4710 additions and 281 deletions

View File

@@ -44,6 +44,11 @@ import {
import { loadVoiceSettingsFromStorage, saveVoiceSettingsToStorage } from '../../domains/voice-session';
import { ScreenShareQualityDialogComponent } from '../../shared';
import { ViewportService } from '../../core/platform';
import { RealtimeSessionFacade } from '../../core/realtime';
import {
isLocalVoiceOwner,
isVoiceOnAnotherClient
} from '../../domains/voice-session';
import { MobileMediaService, MobilePlatformService } from '../../infrastructure/mobile';
import { selectAllUsers, selectCurrentUser } from '../../store/users/users.selectors';
import { UsersActions } from '../../store/users/users.actions';
@@ -85,6 +90,7 @@ export class PrivateCallComponent {
private readonly destroyRef = inject(DestroyRef);
private readonly store = inject(Store);
private readonly calls = inject(DirectCallService);
private readonly realtime = inject(RealtimeSessionFacade);
private readonly voice = inject(VoiceConnectionFacade);
private readonly voiceActivity = inject(VoiceActivityService);
private readonly playback = inject(VoicePlaybackService);
@@ -437,18 +443,38 @@ export class PrivateCallComponent {
isParticipantConnected(user: User): boolean {
const session = this.session();
const userId = this.userKey(user);
const current = this.currentUser();
if (!session) {
return false;
}
return (
!!session.participants[userId]?.joined ||
!!(user.voiceState?.isConnected && user.voiceState.roomId === session.callId && user.voiceState.serverId === session.callId)
const inCallVoice = !!(
user.voiceState?.isConnected
&& user.voiceState.roomId === session.callId
&& user.voiceState.serverId === session.callId
);
const isSelf = !!current && (user.id === current.id || user.oderId === current.oderId);
if (isSelf && inCallVoice) {
return isLocalVoiceOwner(user.voiceState, this.realtime.getClientInstanceId());
}
return !!session.participants[userId]?.joined || inCallVoice;
}
isPassiveCallParticipant(user: User): boolean {
const current = this.currentUser();
const isSelf = !!current && (user.id === current.id || user.oderId === current.oderId);
return isSelf && isVoiceOnAnotherClient(user.voiceState, this.realtime.getClientInstanceId());
}
participantIssueLabel(user: User): string | null {
if (this.isPassiveCallParticipant(user)) {
return this.i18n.instant('call.private.voiceOnOtherDevice');
}
return this.isParticipantConnected(user) ? null : this.i18n.instant('call.private.waiting');
}