Closed zoetrope69 closed 2 years ago
We need to clear timeouts on disconnect because some messages can be removed on disconnect before they are resolved.
It looks like when you reconnect Ableton on my Macbook it fires in rapid succession:
This seems to be bug but either way this introduces a unhandled race connection if you have code like this:
ableton.on('connect', () => { ableton.song.addListener('tempo', console.log); });
It seems like the sendCommand function can't be resolved in time as the disconnect event clears everything.
sendCommand
We need to clear timeouts on disconnect because some messages can be removed on disconnect before they are resolved.
Scenario
It looks like when you reconnect Ableton on my Macbook it fires in rapid succession:
This seems to be bug but either way this introduces a unhandled race connection if you have code like this:
It seems like the
sendCommand
function can't be resolved in time as the disconnect event clears everything.