0

I'm a newbie in both react native and couchbase lite, and I try this sample application https://github.com/jmn8718/RNCouchbaseExample.git .

This sample, connect mobile couchbase lite db to a remote sync gateway.

But when mobile go offline, and then go online, replication not reboot or don't detect connection lost. Do you have some idea on how to fix it ? Do I need to track network status myself in mobile app, or use replication with a timer ?

My actual replication code :

function repl() {
     database.replicate(`http://${SG_URL}/${DB_NAME}`, DB_NAME, REPLICATION_OPTIONS)
     .then(res => {
       console.log('replicate:' + util.inspect(res, {showHidden: false, depth: null}) )

       })
}
repl()

Thank you !

heralight
  • 920
  • 1
  • 7
  • 15
  • If the replication is continuous (which is the case in [this example](https://github.com/jmn8718/RNCouchbaseExample/blob/master/app/index.js#L50-L52)) then it will automatically monitor the network using reachability APIs of the platform. Are you observing this on iOS or Android? Or does it happen on both? – jamiltz Oct 22 '16 at 11:02
  • Also, what are the steps you took to switch between offline/online, using airplane mode or stopping Sync Gateway? For how long? – jamiltz Oct 22 '16 at 11:50

0 Answers0