ForumsDevelopersBug when deleting tasks


Bug when deleting tasks
Author Message
JTMcFarland

Posted: Nov 07, 2017
Score: 0 Reference
I recently noticed that when I delete a task, the server seems to be updating both lastEditTask as well as lastDeleteTask. My understanding is that it should be updating only lastDeleteTask in this scenario. I'm using the toodledo website to delete the task, and then pulling both fields from /3/account/get.php
Jake

Toodledo Founder
Posted: Nov 07, 2017
Score: 0 Reference
lastEditTask will be updated when any task is edited for any reason, including a delete, so this is the correct behavior.
JTMcFarland

Posted: Nov 08, 2017
Score: 0 Reference
I'm not sure I understand this functionality correctly. When I delete a task, lastedit_task gets updated indicating there was a change made, yet calls to the API for edits yield no result. This seems to mean the request for edits was unnecessary. This seems important based on the API documentation <http://api.toodledo.com/3/account/doc_sync.php> where it states "It is very important to be frugal with the API". So how can I avoid making the unnecessary request for edits when only deletes have occurred?


According to the API documentation for /3/account/get.php is as follows...

lastedit_task : A timestamp that indicates the last time that any task was added or edited on this account. You can quickly check this field to determine if you need to download updates.

lastdelete_task : A timestamp that indicates the last time that any task was deleted from this account. You can quickly check this field to determine if you need to identify and remove tasks from your application.

Based on the recommendations flowchart for task syncing (at http://api.toodledo.com/3/tasks/index.php), I see the association between lastedit_task and "tasks/get.php" as well as lastdelete_task and "/tasks/deleted.php". However I see no indication that lastedit_task should yield any kind of result when a task is deleted. If this is correct, I'm not sure I understand the value in updating lastedit_task when a task is deleted. It seems to be causing unnecessary API calls from a client, and unnecessary load on the service/servers when checking for non-existing edits.


Is there a use case I'm missing here, or something I'm misunderstanding?
Jake

Toodledo Founder
Posted: Nov 08, 2017
Score: 0 Reference
You are correct. It would be better if the edited timestamp did not increment when a task was deleted. For historical backwards compatibility reasons, we cant change this, so yes, there will be an unnecessary fetch in the case where only a task was deleted. In practice, edits/adds are much more common than deletes, so its an edge case.
JTMcFarland

Posted: Nov 09, 2017
Score: 0 Reference
Thanks for the feedback on this. :-)
You cannot reply yet

U Back to topic home

R Post a reply

To participate in these forums, you must be signed in.