1
0
mirror of https://github.com/etesync/android synced 2025-01-23 22:21:23 +00:00

Always log deletes, even when not previously added to server.

Before this change we would only add "deletes" to the server when the
resource has been previously uploaded. This means that if a resource has
been created and then deleted before a sync, it would not be saved,
which is essentially data-loss.
This commit fixes it, so we always upload a delete entry.
This commit is contained in:
Tom Hacohen 2017-03-24 14:08:55 +00:00
parent 99fe3457fc
commit 84244330b7

View File

@ -404,13 +404,8 @@ abstract public class SyncManager {
if (Thread.interrupted()) if (Thread.interrupted())
return ret; return ret;
if (!local.isLocalOnly()) {
App.log.info(local.getUuid() + " has been deleted locally -> deleting from server"); App.log.info(local.getUuid() + " has been deleted locally -> deleting from server");
ret.add(local); ret.add(local);
} else {
App.log.info("Removing local record #" + local.getId() + " which has been deleted locally and was never uploaded");
local.delete();
}
syncResult.stats.numDeletes++; syncResult.stats.numDeletes++;
} }