ginatrapani/todo.txt-touch — Issue #262: Enhancement: Semi-automatic sync after switching from offline to online mode
Author: tomtom
Created: 2012-03-03 21:31:42+00:00
State: open

Hi,

I usually use todo.txt-touch in offline mode and I sync my todo list only now and then. This is usually done by switching from offline to online mode which results in todo.txt-touch asking me whether I want to download or upload the list. After I have lost some tasks by making the wrong decision, I wonder if todo.txt-touch shouldn't be smarter than me with respect to syncing files. I'd like to propose the following behaviour:

- todo.txt-touch keeps metainfo about the file on disk (i.e. the work file) and the file last downloaded from dropbox. This could be either the mtime or, better, a md5/sha1 hash value of the text.
- todo.txt-touch should then have two data points available to check whether it's save to download the file from dropbox: (hash1) the file last downloaded from dropbox, (hash2) the current work file
. If hash1 and hash2 match, it's save to download the file from dropbox (there doesn't seem to be much sense in uploaded the file, which is why the user shouldn't be queried if he/she wants to make a wrong decision).
- If hash1 and hash2 doesn't match, the local file has changed and the user most likely wants to upload the file or, if the file on dropbox has changed too, perform a merge (I'm aware that todo.txt-touch doesn't support proper merging yet). Todo.txt-touch could check the file on dropbox by downloading it and calculating its hash value (hash3). If hash1 equals hash3, it's save to upload the local work file. Otherwise, the user has to do something about it -- as long as todo.txt-touch isn't capable of handling such editing conflicts.

Is there a chance something like that gets included in todo.txt-touch? If not, is there a chance that todo.txt-touch at least gets numbered backups of the local work file?

Regards,
Tom