braverhealth / phoenix-socket-dart

Cross-platform and stream-based implementation of Phoenix Sockets
https://pub.dev/packages/phoenix_socket
BSD 3-Clause "New" or "Revised" License
73 stars 37 forks source link

Fix occasional issue when reconnecting #28

Closed matehat closed 3 years ago

matehat commented 3 years ago

If a heartbeat was still pending when a full reconnection was attempted, PhoenixSocket would interpret that as a timed out heartbeat immediately and consider the connection failed.

This PR fixes this by not considering previous heartbeat attempts when re-starting a new connection.