Open christopherjwhite opened 10 years ago
With respect to the function org-toodledo-mark-task-deleted
, it does not appear essential to use org-toodledo-parse-current-task
because only insertion of the ID into OrgToodledoPendingDeletes
is needed. The ID can be obtained by using (org-entry-get (point) "ToodledoID")
. Once that ID is inserted into OrgToodledoPendingDeletes
, the task can be immediately archived in a separate file using org-archive-subtree
or simply delete-region
of same (depending on the value of org-toodledo-archive-deleted-tasks
). As long as the master todo file is saved, synchronization can occur at a later time or a later date -- the server does not need to be contacted when simply deleting or archiving. Unless, I am missing something . . .?
The code refers in a few places to a property drawer with a name of "Deleted" and a potential value of 1
; however, I could not find where (in the code) that property drawer is actually created. Has that been implemented yet?
Right now, any action that requires parsing the task requires name->id maps for folders, contexts, and goals, as well as whether this is a pro account. This is pulled from the server and cached in memory for the first such call. That means some actions, such as marking a task as deleted, require an internet connection if no sync has been completed yet.
Workaround - after opening the todo org-mode file, call org-sync while online, then don't close the emacs. This will cache the variables and should allow offline operations until org-toodledo-sync is called.
Refactor the code a bit to handle this. Two options in org-toodledo-parse-current-task:
Option 2 is probably the safer approach as far as coding goes, as it touches much less code.