SocketCluster / socketcluster-client

JavaScript client for SocketCluster
MIT License
290 stars 92 forks source link

eventObject timeout has a timeout set when it's not expecting a response #152

Open gak10100 opened 8 months ago

gak10100 commented 8 months ago

Inside the _processOutboundEvent event Objects are created and a timeout is set. The problem is that a timeout is set for event objects that aren't expecting a response.

https://github.com/SocketCluster/socketcluster-client/blob/f5514434f51369166de9e5dafba2f7da147fb93e/lib/clientsocket.js#L773-L781

Inside the _flushOutboundBuffer function Event Objects are passed off to the transport object

https://github.com/SocketCluster/socketcluster-client/blob/f5514434f51369166de9e5dafba2f7da147fb93e/lib/clientsocket.js#L709-L720

but because the event object doesn't have a callback it doesn't add it to the callbackMap

https://github.com/SocketCluster/socketcluster-client/blob/f5514434f51369166de9e5dafba2f7da147fb93e/lib/transport.js#L373C10-L387

This can lead to the timeout to hang even after the client has disconnected.