code: function compareReplicationLogs(srcDoc, tgtDoc) {
    if (srcDoc.session_id === tgtDoc.session_id) {
      return {
        last_seq: srcDoc.last_seq,
        history: srcDoc.history
      };
    }
  
    return compareReplicationHistory(srcDoc.history, tgtDoc.history);
  }
docs: This checkpoint comparison is ported from CouchDBs source they come from here: https://github.com/apache/couchdb-couch-replicator/blob/master/src/couch_replicator.erl#L863-L906