Don't record outstanding entries in MakeChanges

pull/14/head
Sam Bosley 12 years ago
parent 3847e03774
commit dfa8b99aa7

@ -23,6 +23,7 @@ import com.todoroo.andlib.sql.Criterion;
import com.todoroo.andlib.sql.Query;
import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.astrid.data.OutstandingEntry;
import com.todoroo.astrid.data.SyncFlags;
@ -235,7 +236,8 @@ public class DatabaseDao<TYPE extends AbstractModel> {
}
private boolean insertOrUpdateAndRecordChanges(TYPE item, ContentValues values, DatabaseChangeOp op) {
boolean recordOutstanding = (outstandingTable != null);
boolean recordOutstanding = (outstandingTable != null) &&
!item.checkAndClearTransitory(SyncFlags.ACTFM_SUPPRESS_OUTSTANDING_ENTRIES);
final AtomicBoolean result = new AtomicBoolean(false);
if (recordOutstanding) { // begin transaction

@ -12,4 +12,6 @@ public class SyncFlags {
public static final String GTASKS_SUPPRESS_SYNC = "gtasks_suppress_sync";
public static final String ACTFM_SUPPRESS_OUTSTANDING_ENTRIES = "actfm-suppress-outstanding";
}

@ -15,6 +15,7 @@ import com.todoroo.andlib.data.Property.LongProperty;
import com.todoroo.andlib.data.Property.StringProperty;
import com.todoroo.astrid.dao.RemoteModelDao;
import com.todoroo.astrid.data.RemoteModel;
import com.todoroo.astrid.data.SyncFlags;
@SuppressWarnings("nls")
public class MakeChanges<TYPE extends RemoteModel> extends ServerToClientMessage {
@ -52,6 +53,7 @@ public class MakeChanges<TYPE extends RemoteModel> extends ServerToClientMessage
if (model.getSetValues().size() > 0) {
if (dao.update(RemoteModel.UUID_PROPERTY.eq(uuid), model) <= 0) { // If update doesn't update rows, create a new model
model.putTransitory(SyncFlags.ACTFM_SUPPRESS_OUTSTANDING_ENTRIES, true);
dao.createNew(model);
}
}

Loading…
Cancel
Save