From c1f4599fb55c286fc020ced7dd75d79478e137c4 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Fri, 8 Mar 2013 13:01:25 -0800 Subject: [PATCH] Clear deleted entities from database on different user login --- .../com/todoroo/astrid/actfm/ActFmLoginActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmLoginActivity.java b/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmLoginActivity.java index 3aa70889f..a522f8c9b 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmLoginActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmLoginActivity.java @@ -657,11 +657,15 @@ public class ActFmLoginActivity extends FragmentActivity implements AuthListener @Override public void run() { // Delete all tasks not assigned to self - taskService.deleteWhere(Task.USER_ID.neq(0)); + taskService.deleteWhere(Criterion.or(Task.USER_ID.neq(0), Task.DELETION_DATE.gt(0))); // Delete user table userDao.deleteWhere(Criterion.all); // Delete attachments table taskAttachmentDao.deleteWhere(Criterion.all); + // Delete deleted tags + tagDataDao.deleteWhere(TagData.DELETION_DATE.gt(0)); + // Delete deleted metadata + metadataDao.deleteWhere(Metadata.DELETION_DATE.gt(0)); // Clear all outstanding tables taskOutstandingDao.deleteWhere(Criterion.all);