-
Notifications
You must be signed in to change notification settings - Fork 16
fix: added peer connection state listener to emit closed events #134
Conversation
@@ -183,13 +184,30 @@ export class WebRTCDirectTransport implements Transport { | |||
} | |||
} | |||
|
|||
const eventListeningName = isFirefox ? 'iceconnectionstatechange' : 'connectionstatechange' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally it's better to check if a capability is present or not. But that being said, I'm not sure off the top of my head how I would check for this. So I think it's okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, well iceconnectionstatechange
event has been supported since Firefox 24 which is about a decade old, and connectionstatechange
has been supported for at least two years in all other browsers, so I would say this is low risk.
🎉 This PR is included in version 1.1.8 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The
RTCPeerConnection
state is not being monitored, as a result thepeer:Disconnect
event which is triggered by aconnectionEnd
event is not fired, resulting in closed connections not being properly propogated.We can listen for disconnect events using the RTCPeerConnection connectionstatechange event
Closes: #138