#StackBounty: #javascript #react-native #couchdb #pouchdb #pouchdb-adapter-localstorage PouchDB and React-Native not replicating .to() …

Bounty: 50

For some reason documents created on my app are not showing up on my remote couchdb database.

I am using the following

import PouchDB from 'pouchdb-react-native'

let company_id = await AsyncStorage.getItem('company_id');
let device_db = new PouchDB(company_id, {auto_compaction: true});
let remote_db = new PouchDB('https://'+API_KEY+'@'+SERVER+'/'+company_id, {ajax: {timeout: 180000}});

device_db.replicate.to(remote_db).then((resp) => {

    console.log(JSON.stringify(resp));
    console.log("Device to Remote Server - Success");
    return resp;

}, (error) => { 

  console.log("Device to Remote Server - Error");
  return false; 

});

I get a successful response the response:

{
  "ok":true,
  "start_time":"2018-05-17T15:19:05.179Z",
  "docs_read":0,
  "docs_written":0,
  "doc_write_failures":0,
  "errors":[

  ],
  "last_seq":355,
  "status":"complete",
  "end_time":"2018-05-17T15:19:05.555Z"
}

When I go to my remote database, document_id’s that am able to search and grab on the application do not show up.

  • Is there something I am not taking into account?
  • Is there anything I can do to check why this might be happening?
  • This worked when I used the same scripting method in Ionic and when I switched to React-Native I noticed this is the case.

NOTE: When I do .from() and get data from remote to the device, I get the data. For some reason it just isn’t pushing data out


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.