diff --git a/api/src/Kurs.Platform.HttpApi.Host/Classroom/ClassroomHub.cs b/api/src/Kurs.Platform.HttpApi.Host/Classroom/ClassroomHub.cs index 6baea039..d48e0973 100644 --- a/api/src/Kurs.Platform.HttpApi.Host/Classroom/ClassroomHub.cs +++ b/api/src/Kurs.Platform.HttpApi.Host/Classroom/ClassroomHub.cs @@ -422,6 +422,9 @@ public class ClassroomHub : Hub await Clients.Client(connectionId) .SendAsync("ForceDisconnect", "You have been removed from the class."); + // 🔑 Mesajın client’a ulaşmasını bekle + await Task.Delay(200); + await Groups.RemoveFromGroupAsync(connectionId, sessionId.ToString()); } @@ -567,11 +570,10 @@ public class ClassroomHub : Hub participant.IsActive = false; participant.ConnectionId = null; await _participantRepository.UpdateAsync(participant, autoSave: true); - } - // 🔑 Frontend’e bildir - await Clients.Group(participant.SessionId.ToString()) - .SendAsync("ParticipantLeft", new { UserId = userId.Value, SessionId = participant.SessionId }); + await Clients.Group(participant.SessionId.ToString()) + .SendAsync("ParticipantLeft", new { UserId = userId.Value, SessionId = participant.SessionId }); + } } } diff --git a/ui/src/services/classroom/signalr.ts b/ui/src/services/classroom/signalr.ts index 5b5e1c53..8165f7e8 100644 --- a/ui/src/services/classroom/signalr.ts +++ b/ui/src/services/classroom/signalr.ts @@ -143,8 +143,7 @@ export class SignalRService { }) this.connection.on('ForceDisconnect', async (message: string) => { - console.warn('⚠️ ForceDisconnect received:', message) - + console.warn('🚨 ForceDisconnect geldi:', message) this.isKicked = true if (this.onForceCleanup) {