momentohq / client-sdk-javascript

Official JavaScript SDK for Momento Serverless Cache
Apache License 2.0
55 stars 20 forks source link

fix: improve TopicClient connection resiliency #1400

Closed cprice404 closed 3 months ago

cprice404 commented 3 months ago

At some point in time a refactor seems to have made the TopicClient less resilient to network interruptions. It may have happened when we made changes to disable keepalives by default (due to lambda issues), or during some refactor work to add topics support to the web SDK.

This commit does the following:

I tested this on my laptop by disabling my wifi after the subscription was created. Prior to these changes, the network issues were not detected and the connection was left in a broken state. After these changes, the issues are detected and the connection is re-established successfully.

cprice404 commented 3 months ago

I tested locally as well, reconnects after wifi off/on, but does not stay active after an idle period of 5min, which is what we aimed for with dart and swift sdks

thanks for testing! what happened after 5 mins?