diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/AstridNewSyncMigrator.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/AstridNewSyncMigrator.java index 8fe916556..a894abfd1 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/AstridNewSyncMigrator.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/AstridNewSyncMigrator.java @@ -170,12 +170,15 @@ public class AstridNewSyncMigrator { String recurrence = instance.getValue(Task.RECURRENCE); if (!TextUtils.isEmpty(recurrence)) { + String fromCompletion = ";FROM=COMPLETION"; boolean repeatAfterCompletion = instance.getFlag(Task.FLAGS, Task.FLAG_REPEAT_AFTER_COMPLETION); instance.setFlag(Task.FLAGS, Task.FLAG_REPEAT_AFTER_COMPLETION, false); recurrence = recurrence.replaceAll("BYDAY=;", ""); - if (repeatAfterCompletion) - recurrence = recurrence + ";FROM=COMPLETION"; + if (fromCompletion.equals(recurrence)) + recurrence = ""; + else if (repeatAfterCompletion) + recurrence = recurrence + fromCompletion; instance.setValue(Task.RECURRENCE, recurrence); } } diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/messages/ChangesHappened.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/messages/ChangesHappened.java index 12cd11537..ac07e0d69 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/messages/ChangesHappened.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/messages/ChangesHappened.java @@ -4,6 +4,7 @@ import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; import org.apache.http.entity.mime.MultipartEntity; import org.apache.http.entity.mime.content.FileBody; @@ -110,6 +111,7 @@ public class ChangesHappened valueRef = new AtomicReference(); for (OE change : changes) { try { String localColumn = change.getValue(OutstandingEntry.COLUMN_STRING_PROPERTY); @@ -150,9 +152,12 @@ public class ChangesHappened property, Object value) { + private boolean validateValue(Property property, AtomicReference valueRef) { if (Task.TITLE.equals(property)) { - if (!(value instanceof String) || TextUtils.isEmpty((String) value)) + if (!(valueRef.get() instanceof String) || TextUtils.isEmpty((String) valueRef.get())) return false; + } else if (Task.RECURRENCE.equals(property)) { + if (";FROM=COMPLETION".equals(valueRef.get())) + valueRef.set(""); } return true; }