couchbaselabs / react-native-couchbase-lite

Couchbase Lite binding for React Native Android & iOS
MIT License
110 stars 53 forks source link

Is connection_timeout respected somehow in server.post_replicate? #144

Open greenais opened 6 years ago

greenais commented 6 years ago

Hi, first of all let me thank team for upgrading lib to the most recent CBL version 1.4, improving linking (BTW, manifests still should be added manually) and sorting out some mess in docs and .help(). Really great job, guys.

The question: is there way to make RNCBL respect connection_timeout prop in server.post_replicate body for one-time (not continuous/poll) replication? I tried to set different values with no effect: RNCBL always timeouts replication call after ~70 sec (returning err in my .catch() routine), which in my case is a way too long.

My request code is:

cbl.server.post_replicate({body: {
      source: syncURL,
      target: localDB,
      connection_timeout: 5000,
      filter: 'sync_gateway/bychannel',
      query_params: {channels: channelsList},
      cancel: false,
      attachments: false,
      continuous: false
    }})
.catch((err)=> {
      console.log(' !!!!!!!!!!!!!!! syncChannels ERR: ', err.status)
})

Any ideas, perhaps?