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 1b83b4ed1..12cd11537 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 @@ -80,6 +80,8 @@ public class ChangesHappened(); + if (!foundEntity) // Stop sending changes for entities that don't exist anymore + outstandingDao.deleteWhere(OutstandingEntry.ENTITY_ID_PROPERTY.eq(id)); } @Override diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/messages/ClientToServerMessage.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/messages/ClientToServerMessage.java index c6e6229e4..fff800665 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/messages/ClientToServerMessage.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/messages/ClientToServerMessage.java @@ -20,6 +20,7 @@ public abstract class ClientToServerMessage { protected final long id; protected final String uuid; protected final long pushedAt; + protected final boolean foundEntity; public static final String TYPE_KEY = "type"; public static final String TABLE_KEY = "table"; @@ -32,6 +33,7 @@ public abstract class ClientToServerMessage { this.table = NameMaps.getServerNameForTable(tableClass); this.uuid = uuid; this.pushedAt = pushedAt; + this.foundEntity = true; this.id = AbstractModel.NO_ID; } @@ -42,6 +44,7 @@ public abstract class ClientToServerMessage { this.table = NameMaps.getServerNameForTable(tableClass); TYPE entity = getEntity(id, modelDao); + this.foundEntity = entity != null; if (entity == null) { this.uuid = RemoteModel.NO_UUID; this.pushedAt = 0;