Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimize calls to the server until syncing #25

Open
christopherjwhite opened this issue Sep 22, 2013 · 1 comment
Open

Minimize calls to the server until syncing #25

christopherjwhite opened this issue Sep 22, 2013 · 1 comment

Comments

@christopherjwhite
Copy link
Owner

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:

  1. Don't convert names to ids here, just store the names and convert to ids at sync time. Need to also somehow delay actions based on pro-mode.
  2. Cache the name->id maps and pro-mode in properties in the file and refresh them on each org-sync.

Option 2 is probably the safer approach as far as coding goes, as it touches much less code.

@lawlist
Copy link

lawlist commented Dec 27, 2014

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants