fix: crash lors deconnexion LiveKit (destructuring undefined)
- LiveKitClient.emit('disconnected') envoie maintenant {reason}
- AudioBridge gere disconnected avec data optionnel (data?.reason)
- Corrige TypeError Cannot destructure property 'reason' of undefined
- Permet reload AudioBridge sans crash serveur
This commit is contained in:
@@ -81,7 +81,7 @@ define(['./workbox-290dd570'], (function (workbox) { 'use strict';
|
|||||||
"revision": "3ca0b8505b4bec776b69afdba2768812"
|
"revision": "3ca0b8505b4bec776b69afdba2768812"
|
||||||
}, {
|
}, {
|
||||||
"url": "index.html",
|
"url": "index.html",
|
||||||
"revision": "0.sfd7biirdr8"
|
"revision": "0.oebo7b1mt4g"
|
||||||
}], {});
|
}], {});
|
||||||
workbox.cleanupOutdatedCaches();
|
workbox.cleanupOutdatedCaches();
|
||||||
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
|
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -311,7 +311,8 @@ export class AudioBridge extends EventEmitter {
|
|||||||
console.log('✓ LiveKit connecté');
|
console.log('✓ LiveKit connecté');
|
||||||
});
|
});
|
||||||
|
|
||||||
this.liveKitClient.on('disconnected', ({ reason }) => {
|
this.liveKitClient.on('disconnected', (data) => {
|
||||||
|
const reason = data?.reason || 'unknown';
|
||||||
console.warn('⚠️ LiveKit déconnecté:', reason);
|
console.warn('⚠️ LiveKit déconnecté:', reason);
|
||||||
this.stats.errors.network++;
|
this.stats.errors.network++;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -143,10 +143,10 @@ export class LiveKitClient extends EventEmitter {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Déconnexion
|
// Déconnexion
|
||||||
this.room.on(RoomEvent.Disconnected, () => {
|
this.room.on(RoomEvent.Disconnected, (reason) => {
|
||||||
console.log('⚠ Room déconnectée');
|
console.log('⚠ Room déconnectée:', reason);
|
||||||
this.isConnected = false;
|
this.isConnected = false;
|
||||||
this.emit('disconnected');
|
this.emit('disconnected', { reason: reason || 'unknown' });
|
||||||
});
|
});
|
||||||
|
|
||||||
// Participants
|
// Participants
|
||||||
@@ -331,7 +331,7 @@ export class LiveKitClient extends EventEmitter {
|
|||||||
this.isConnected = false;
|
this.isConnected = false;
|
||||||
this.remoteParticipants.clear();
|
this.remoteParticipants.clear();
|
||||||
console.log('✓ Déconnecté de LiveKit');
|
console.log('✓ Déconnecté de LiveKit');
|
||||||
this.emit('disconnected');
|
this.emit('disconnected', { reason: 'manual' });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user