mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-27 05:38:51 +01:00
✨ feat: improve WebRTC connection state handling and enhance WebSocket connection logic
This commit is contained in:
parent
2eda62cf67
commit
bf753bb5dd
2 changed files with 17 additions and 8 deletions
|
|
@ -69,9 +69,8 @@ class WebRTCConnection {
|
|||
|
||||
const state = this.peerConnection.connectionState;
|
||||
logger.info(`Connection state changed to ${state}`);
|
||||
this.state = state;
|
||||
|
||||
if (state === 'failed' || state === 'closed') {
|
||||
if (state === 'failed' || state === 'closed' || state === 'disconnected') {
|
||||
this.cleanup();
|
||||
}
|
||||
};
|
||||
|
|
@ -148,8 +147,8 @@ class AudioHandler {
|
|||
rtcConnection.addIceCandidate(candidate);
|
||||
});
|
||||
|
||||
socket.on('vad-status', (status) => {
|
||||
logger.debug(`VAD status from ${socket.id}: ${JSON.stringify(status)}`);
|
||||
socket.on('vad-status', (speaking) => {
|
||||
logger.debug(`VAD status from ${socket.id}: ${JSON.stringify(speaking)}`);
|
||||
});
|
||||
|
||||
socket.on('disconnect', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue