MCPcopy Index your code
hub / github.com/share/sharedb / submit

Function submit

test/db.js:76–87  ·  view source on GitHub ↗
(db, collection, id, op, callback)

Source from the content-addressed store, hash-verified

74 // snapshot before committing. Thus, commit may rely on the behavior
75 // of getSnapshot with this special projection
76 function submit(db, collection, id, op, callback) {
77 db.getSnapshot(collection, id, {$submit: true}, null, function(err, snapshot) {
78 if (err) return callback(err);
79 if (snapshot.v !== op.v) {
80 var succeeded = false;
81 return callback(null, succeeded);
82 }
83 var err = ot.apply(snapshot, op);
84 if (err) return callback(err);
85 db.commit(collection, id, op, snapshot, null, callback);
86 });
87 }
88
89 describe('commit', function() {
90 function commitConcurrent(db, ops, test, done) {

Callers 2

commitConcurrentFunction · 0.85
db.jsFile · 0.85

Calls 1

callbackFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…