pladaria / reconnecting-websocket

Reconnecting WebSocket. For Web, React Native, cli (Node.js)
MIT License
1.22k stars 197 forks source link

_uptimeTimeout is never cleared on disconnect, causing incorrect reporting of retryCount #83

Closed flyweight closed 5 years ago

flyweight commented 5 years ago

Actual Behavior

In _handleOpen, the _uptimeTimeout variable is set to call _acceptOpen after a set amount of time. Currently, _acceptOpen is always called because _uptimeTimeout is never cleared if the connection happens to close during the period.

https://github.com/pladaria/reconnecting-websocket/blob/5074de85b0d1ba94190260a32be5453bcd4e30e1/dist/reconnecting-websocket-iife.js#L489

Expected Behavior

During a disconnect, the _uptimeTimeout should be cleared properly.

pladaria commented 5 years ago

Hi,

This problem has been fixed in latest release (v4.1.7).

Thanks for reporting!

flyweight commented 5 years ago

Thanks, @pladaria 👍