Permalink
Browse files

Added code to check if the task has been incorrectly deleted

  • Loading branch information...
1 parent 236ee06 commit 3cfea99a5e1345241359a9542d8f6f3caa916e44 @stayradiated stayradiated committed May 19, 2012
Showing with 17 additions and 0 deletions.
  1. +17 −0 sync.js
View
17 sync.js
@@ -1707,6 +1707,15 @@ function merge(server, client, callback) {
server.tasks[task] = clone(client.tasks[task]);
}
+
+
+ /***** TASK DOESN'T EXIST ON SERVER FOR SOME REASON -- BUG *****/
+ } else if (!server.tasks.hasOwnProperty(task)) {
+
+ console.log(color("Task doesn't exist on server. It should, but it doesn't.", "red"));
+
+ // Better just copy the task onto the server...
+ server.tasks[task] = clone(client.tasks[task]);
/***** CLIENT DELETED TASK *****/
@@ -1903,6 +1912,14 @@ function merge(server, client, callback) {
server.lists.scheduled[task] = clone(client.lists.scheduled[task]);
}
+
+ /***** TASK DOESN'T EXIST ON SERVER FOR SOME REASON -- BUG *****/
+ } else if (!server.tasks.hasOwnProperty(task)) {
+
+ console.log(color("Task doesn't exist on server. It should, but it doesn't.", "red"));
+
+ // Better just copy the task onto the server...
+ server.lists.scheduled[task] = clone(client.lists.scheduled[task]);
/***** CLIENT DELETED TASK *****/

0 comments on commit 3cfea99

Please sign in to comment.