(db, collection, id, op, callback)
| 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) { |
no test coverage detected
searching dependent graphs…