jmanuel1 / todoer

Automatically add an email to your local todo.txt when you star it.
MIT License
4 stars 1 forks source link

Backup the todo.txt file on every modification #10

Open jmanuel1 opened 3 years ago

jmanuel1 commented 3 years ago

At present, the file as backed up only when the plugin is activated. To protect against data loss due to file corruption, the todo.txt should be copied regularly instead. I propose copying after every modification.

Also, maybe I should look into a better way to asynchronously read and write from a file safely. If I can do 'the right thing', then I might start actually using the plugin.

This issue refers to the following TODO:

https://github.com/jmanuel1/todoer/blob/e759e3999d6971e88586fd5e20efaff7ca416b8e/lib/main.es6#L60

jmanuel1 commented 3 years ago

Google Drive, where I store my todo.txt, keeps previous versions of the file for up to 30 days (unless I choose to keep a revision forever). I think this is good enough for me, so I will deprioritize this issue.