I am using PouchDB 5.3 with Couchbase Sync Gateway 1.2, with the sync function. It works without any problem when I use a small set of records (20 .. 50). But I have problems when I use 3K, because the first time that try to synchronize, it has around 17K request to the server.
This is the configuration with this problem:
this.sync = function(remoteDatabase, onComplete, onError) {
database.sync(remoteDatabase, {
live: true,
retry: false
}).on('change', function(change) {
// yo, something changed!
console.log("Sync Change");
}).on('paused', function(info) {
// replication was paused, usually because of a lost connection
console.log("Sync Paused");
if (onComplete)
onComplete();
}).on('active', function(info) {
// replication was resumed
console.log("Sync Active");
}).on('error', function(err) {
// totally unhandled error (shouldn't happen)
console.log("Sync Error", err);
if (onError)
onError();
}).on('complete', function(info) {
console.log("Sync Complete");
}).then(function(info) {
console.log("Sync Complete");
});
}
Also, it is not possible to detect when this 17k requests are done.
If I set the live method to false, it only has around of 3k requests, but after that, it is not possible to sync when some changes is made on any of both sides.
This are the set of repeated requests (with differents uuids)
http://...._bulk_docs?_nonce=1457702282722
http://...._bulk_docs?_nonce=1457702282722
http://....._revs_diff?_nonce=1457702282818
http://....._revs_diff?_nonce=1457702282818
http://....._local/EhRrzqajjvWCiEqNXBk87A%3D%3D?
http://....._local/EhRrzqajjvWCiEqNXBk87A%3D%3D?
Any idea about how to prevent this 17k requests??
And if this is mandatory to do, any idea about how to detect once is finished?
Thanks!
Follow this problem on https://github.com/pouchdb/pouchdb/issues/4975