syncromatics / syncromatics-track-api

Library to interact with the Syncromatics Track API
https://www.npmjs.com/package/syncromatics-track-api
6 stars 1 forks source link

fix(reconnect): Also reconnect pending connections. #65

Closed cuevaskoch closed 4 years ago

cuevaskoch commented 4 years ago

Commit 28bf0d introduced a feature where active subscriptions made via the real-time client would resubscribe upon a disconnect and reconnect.

This could pose a problem if Track API was having errors connecting to its backing services, because the client might get into a state where only some of the subscriptions it tries to restart will actually restart. Then, on the next disconnect/reconnect, it will only restart the ones that started successfully.

This PR makes sure that subscriptions that were pending at the time of the disconnect are also restarted.

Signed-off-by: Jeff Cuevas-Koch jcuevas-koch@gmvsync.com