Fix:
Fix this issue by not deleting tasks which are in State COMPLETED,
ACTIVE, and DEACTIVATED.
Fixes:
@@ -75,7 +75,9 @@ public class TaskQueryHelper {
"UPDATE " + TABLE_NAME + " SET " + DESTINED_NODE_ID + " = NULL , " + TASK_STATE + " = " + TASK_STATE_CONST
+ " WHERE " + TASK_NAME + " =?";
- static final String REMOVE_TASKS_OF_NODE = "DELETE FROM " + TABLE_NAME + " WHERE " + DESTINED_NODE_ID + " =?";
+ static final String REMOVE_TASKS_OF_NODE = "DELETE FROM " + TABLE_NAME + " WHERE " + DESTINED_NODE_ID + " =? AND "
+ + TASK_STATE + " NOT IN ('" + CoordinatedTask.States.COMPLETED + "', '" + CoordinatedTask.States.ACTIVATED
+ + "', '" + CoordinatedTask.States.DEACTIVATED + "')";
static final String DELETE_TASK = "DELETE FROM " + TABLE_NAME + " WHERE " + TASK_NAME + " =?";
