In sctransport.js, consider emitting disconnect/connectAbort event after calling _abortAllPendingEventsDueToBadConnection
jondubois opened this issue · comments
Jonathan Gros-Dubois commented
Ideally disconnection should happen after events have been cancelled.
Right now this is not the case: https://github.com/SocketCluster/socketcluster-client/blob/master/lib/sctransport.js#L211
First, check that switching the order doesn't cause any negative side effects.
Jonathan Gros-Dubois commented
This ordering of events on the transport object is necessary to allow the socket to handle the disconnect cleanup operations at a higher level before they are cleaned up at the lower (transport) lever.