MCPcopy Index your code
hub / github.com/apache/pouchdb / getDiffs

Function getDiffs

lib/index.js:9926–9948  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9924 }
9925
9926 function getDiffs() {
9927 var diff = {};
9928 currentBatch.changes.forEach(function (change) {
9929 returnValue.emit('checkpoint', { 'revs_diff': change });
9930 // Couchbase Sync Gateway emits these, but we can ignore them
9931 /* istanbul ignore if */
9932 if (change.id === "_user/") {
9933 return;
9934 }
9935 diff[change.id] = change.changes.map(function (x) {
9936 return x.rev;
9937 });
9938 });
9939 return target.revsDiff(diff).then(function (diffs) {
9940 /* istanbul ignore if */
9941 if (returnValue.cancelled) {
9942 completeReplication();
9943 throw new Error('cancelled');
9944 }
9945 // currentBatch.diffs elements are deleted as the documents are written
9946 currentBatch.diffs = diffs;
9947 });
9948 }
9949
9950 function getBatchDocs() {
9951 return getDocs(src, target, currentBatch.diffs, returnValue).then(function (got) {

Callers 1

startNextBatchFunction · 0.70

Calls 1

completeReplicationFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…