-
-
Notifications
You must be signed in to change notification settings - Fork 71
Closed
Description
Describe the Bug
In certain cases, the PeerConnection.close() polyfill seems to block the event loop. Profiling has shown that the PeerConnection.close() method sometimes takes ~1 second to execute instead of the usual few milliseconds.
Additionally, the datachannel.readyState does not always correctly reflect its real state. This inconsistency can lead to issues such as attempting to send messages on a data channel that appears open but is not actually open. Check the additional context for more insight.
To Reproduce
Steps to reproduce the issue:
- Open a WebRTC connection.
- Trigger a
PeerConnection.close()call. - Observe that the event loop may be blocked, even for ~1 second.
- Check the
datachannel.readyStatebefore and after the.close()call to confirm state inconsistencies.
Expected Behavior
- The
PeerConnection.close()polyfill should clean up the connection asynchronously and avoid blocking the event loop. - The
datachannel.readyStateshould accurately reflect the real state of the data channel.
Device Information
- Node.js Version: 20.x LTS
Additional Context
SebaM90
Metadata
Metadata
Assignees
Labels
No labels