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:
Add configuration options for grpc keepalives and enable them in the default topicclient config
Adds a good deal of trace-level logging to help debug what is happening when subscriptions are interrupted
Re-work the error-handling and "end of stream" logic a bit to improve connection resiliency.
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.
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
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.