couchbase/couchbase-lite-ios

Replicator isn't notified when internet connection drops. Perhaps kDefaultHeartBeatInterval set too high?

vx8 opened this issue · 1 comments

vx8 commented

Describe the bug
We noticed that if we remove internet connection (keeping wifi active) the replicator hangs and doesn't go in .offline status until 5 minutes pass. We noticed in the codebase you have a kDefaultHeartBeatInterval hardcoded to 5 minutes and that's what CBL uses to detect offline status.

Is there a reason why this PING you use to detect connection drop is set so high? Would it be possible to make it configurable? Do you see any issues in lowering this value to for example 30 seconds?

We see in the comment you wrote "Configurable via options". We couldn't find a way to customize it without recompiling cbl from scratch.

To Reproduce
Detach device from internet connection keeping wifi on

Expected behavior
I'd expect the replicator to go in offline mode as soon as possible. The 5 minute timer seems absurd to me

Logs

Screenshots
If applicable, add screenshots to help explain your problem.

Platform (please complete the following information):

  • Device: any iOS Device
  • OS: tested on iOS > 12
  • Couchbase Version CouchbaseLiteSwift 2.7.1

In the upcoming release we will have option to customize the heart beat interval. you will be able to set it in replicator configuration.
https://github.com/couchbase/couchbase-lite-ios/blob/master/Swift/ReplicatorConfiguration.swift#L135