Retrieving the full history of an ODK-X table from the server

Hello,

We are trying to retreive the full history of a table from the ODK-X server using the "Get All Data Changes Since… " API call. We need this because we are trying to make a migrator tool that would migrate the full history from one table to another, and because we want to know what modifications were made by who.

We use the getRowsSince API (/diff) for this, but its not returning all revisions: reason is the computeDiff function that will remove multiple versions within the same response for the same row. we could work around this by setting fetchsize=1 but that would be very slow.

/**
   * Takes a list of rows which are not necessarily all unique and returns a
   * list of unique rows. In the case where there is more than one row with the
   * same rowId, only the last (highest index) row is included in the returned
   * list.
   *
   * @param rows
   *          the rows
   * @return the list of unique rows
   */
  private List<Row> computeDiff(List<Row> rows) {
    Map<String, Row> diff = new HashMap<String, Row>();
    for (Row logRow : rows) {
      diff.put(logRow.getRowId(), logRow);
    }
    return new ArrayList<Row>(diff.values());
  }

Is there any alternatives ? Would a patch be accepted that adds an option to disable the computeDiff logic ?

Thanks,
Ludovic

Hello,

This is an implementation that works for us (without breaking the android clients):

Feedback would be welcome.
Frank