worldmaking / mischmasch

https://www.alicelab.world/msvr
MIT License
9 stars 1 forks source link

High Priority: when webrtc connection times out, this causes a crash of the app #260

Open michaelpalumbo opened 6 months ago

michaelpalumbo commented 6 months ago

the following error occurs sometimes, and when it does it causes the whole app to crash. if webrtc can't connect, shouldn't cause a crash, should be handled and attempt to reconnect. we last multiple play sessions to this where players had nice patches going and then it crashed:


E:\GitHub\mischmasch\node_modules\wrtc\lib\index.js:49
  this._send(data);
       ^
DOMException [InvalidStateError]: RTCDataChannel.readyState is not 'open'
    at RTCDataChannel.send (E:\GitHub\mischmasch\node_modules\wrtc\lib\index.js:49:8)
    at E:\GitHub\mischmasch\Components\Patch\Patch.js:524:52
    at Array.forEach (<anonymous>)
    at Patch.updatePeers (E:\GitHub\mischmasch\Components\Patch\Patch.js:513:37)
    at Patch.update (E:\GitHub\mischmasch\Components\Patch\Patch.js:273:14)
    at Object.updateHandStateMachine (E:\GitHub\mischmasch\app.js:624:12)
    at Object.updateStateMachines (E:\GitHub\mischmasch\app.js:474:37)
    at Immediate.animate (E:\GitHub\mischmasch\app.js:2392:5)
    at process.processImmediate (node:internal/timers:476:21)

pc on the right made a large patch, it was sounding awesome, and then when i reconnected the other pc to the internet, it wiped the pc on the right's scene.