MCPcopy
hub / github.com/apache/pouchdb / onGetMetadata

Function onGetMetadata

lib/index-browser.js:5790–5807  ·  view source on GitHub ↗
(doc, seq, metadata, cb)

Source from the content-addressed store, hash-verified

5788 }
5789
5790 function onGetMetadata(doc, seq, metadata, cb) {
5791 if (metadata.seq !== seq) {
5792 // some other seq is later
5793 return cb();
5794 }
5795
5796 if (metadata.winningRev === doc._rev) {
5797 // this is the winning doc
5798 return cb(metadata, doc);
5799 }
5800
5801 // fetch winning doc in separate request
5802 var docIdRev = doc._id + '::' + metadata.winningRev;
5803 var req = docIdRevIndex.get(docIdRev);
5804 req.onsuccess = function (e) {
5805 cb(metadata, decodeDoc(e.target.result));
5806 };
5807 }
5808
5809 function fetchWinningDocAndMetadata(doc, seq, cb) {
5810 if (docIds && !docIds.has(doc._id)) {

Callers 1

Calls 2

decodeDocFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…