lib/api-syncRecords.js
function listChangesNotInLocalDataset(datasetId, lastSyncTime, clientInfo, cb) {
  async.parallel({
    appliedUpdatesSinceLastSync: async.apply(listAppliedChangeSinceLastSync, datasetId, lastSyncTime, clientInfo),
    pendingChangesForClient: async.apply(listPendingChangesForClient, datasetId, clientInfo)
  }, function(err, results) {
    if (err) {
      return cb(err);
    }
    return cb(null, results.appliedUpdatesSinceLastSync, results.pendingChangesForClient);
  });
}
function listChangesNotInLocalDataset(datasetId, lastSyncTime, clientInfo, cb) {
  async.parallel({
    appliedUpdatesSinceLastSync: async.apply(listAppliedChangeSinceLastSync, datasetId, lastSyncTime, clientInfo),
    pendingChangesForClient: async.apply(listPendingChangesForClient, datasetId, clientInfo)
  }, function(err, results) {
    if (err) {
      return cb(err);
    }
    return cb(null, results.appliedUpdatesSinceLastSync, results.pendingChangesForClient);
  });
}
List all the possible changes that are not in the current local dataset copy yet.
It includes:
- the updates that are applied since last sync loop run from the given client
- the pending changes that are still waiting to be processed for the given client
@param {String} datasetId
@param {Number} lastSyncTime the timestamp of when the last sync loop completed
@param {Object} clientInfo the client info. Should contain the cuid
@param {Function} cb