Log denemesi
This commit is contained in:
parent
b0566b7c6b
commit
0db26ba738
2 changed files with 11 additions and 6 deletions
|
|
@ -110,15 +110,15 @@ export class SignalRService {
|
||||||
})
|
})
|
||||||
|
|
||||||
this.connection.onclose(async (err) => {
|
this.connection.onclose(async (err) => {
|
||||||
// 🚨 İlk satırda kontrol et
|
console.warn('🔥 onclose triggered, isKicked=', this.isKicked)
|
||||||
|
|
||||||
if (this.isKicked) {
|
if (this.isKicked) {
|
||||||
this.isConnected = false
|
this.isConnected = false
|
||||||
this.currentSessionId = undefined
|
this.currentSessionId = undefined
|
||||||
return
|
return // ❗ Kick durumunda kesinlikle LeaveClass çağırma
|
||||||
}
|
}
|
||||||
|
|
||||||
this.isConnected = false
|
this.isConnected = false
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (this.currentSessionId) {
|
if (this.currentSessionId) {
|
||||||
await this.connection.invoke('LeaveClass', this.currentSessionId)
|
await this.connection.invoke('LeaveClass', this.currentSessionId)
|
||||||
|
|
@ -147,12 +147,17 @@ export class SignalRService {
|
||||||
|
|
||||||
this.isKicked = true
|
this.isKicked = true
|
||||||
|
|
||||||
// 🔑 Cleanup’u dışarıya delege et
|
|
||||||
if (this.onForceCleanup) {
|
if (this.onForceCleanup) {
|
||||||
|
console.warn('⚡ ForceCleanup callback çağrılıyor')
|
||||||
this.onForceCleanup()
|
this.onForceCleanup()
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.connection.stop()
|
try {
|
||||||
|
await this.connection.stop()
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('connection.stop hata:', e)
|
||||||
|
}
|
||||||
|
|
||||||
this.isConnected = false
|
this.isConnected = false
|
||||||
|
|
||||||
if (this.currentSessionId && store.getState().auth.user) {
|
if (this.currentSessionId && store.getState().auth.user) {
|
||||||
|
|
|
||||||
|
|
@ -355,7 +355,7 @@ const RoomDetail: React.FC = () => {
|
||||||
|
|
||||||
signalRServiceRef.current.setForceCleanupHandler(() => {
|
signalRServiceRef.current.setForceCleanupHandler(() => {
|
||||||
webRTCServiceRef.current?.closeAllConnections()
|
webRTCServiceRef.current?.closeAllConnections()
|
||||||
localStream?.getTracks().forEach((track) => track.stop())
|
localStream?.getTracks().forEach((t) => t.stop())
|
||||||
})
|
})
|
||||||
|
|
||||||
signalRServiceRef.current.setParticipantLeaveHandler(({ userId, sessionId }) => {
|
signalRServiceRef.current.setParticipantLeaveHandler(({ userId, sessionId }) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue