Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ Thumbs.db
dist
.devcontainer/devcontainer.json
.devcontainer/Dockerfile
.claude/
CLAUDE.md
13 changes: 10 additions & 3 deletions packages/common/src/webrtc/BaseCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -832,8 +832,8 @@ export default abstract class BaseCall implements IWebRTCCall {
})
.catch((error) => {
logger.error('Call setRemoteDescription Error: ', error)
this.hangup()
})
this._disconnectAndReconnect()
})
}

private _requestAnotherLocalDescription() {
Expand Down Expand Up @@ -902,7 +902,7 @@ export default abstract class BaseCall implements IWebRTCCall {
})
.catch((error) => {
logger.error(`${this.id} - Sending ${type} error:`, error)
this.hangup()
this._disconnectAndReconnect()
})
}

Expand Down Expand Up @@ -985,6 +985,13 @@ export default abstract class BaseCall implements IWebRTCCall {
}
}

private _disconnectAndReconnect() {
logger.debug(`${this.id} - Triggering WebSocket reconnection due to error`)
// Trigger a socket error event which will cause the session to reconnect
// The BaseSession's _onSocketCloseOrError handler will automatically reconnect
trigger(SwEvent.SocketError, { type: 'error', message: 'Forced reconnection due to call error' }, this.session.uuid)
}

private _execute(msg: BaseMessage) {
if (this.nodeId) {
msg.targetNodeId = this.nodeId
Expand Down