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

Keep temp files to avoid losing data #90

Merged
merged 1 commit into from
Jul 24, 2019
Merged

Conversation

samuelallan72
Copy link

This prevents tempfiles from editing notes from being cleaned up by
sncli. It also logs the filenames to sncli.log for easy discovery.

Ideally we would have a method to auto clean-up the temp files after a
certain time or when it is sure that the notes have been saved and/or
synced. For now this is a solution anyway. For the privacy conscious,
if this PR is merged, it means that tempfiles from your notes will be
left around in the tempdir until manually cleaned up.

Ref #82

@samuelallan72
Copy link
Author

@qcu, @sobjornstad please review this and let me know if this seems like a solution to #82

@samuelallan72
Copy link
Author

Also pinging @1094 since you 👍 reacted to #82

@sobjornstad
Copy link

sobjornstad commented Jul 23, 2019

Feels a little messy to just leave them lying around, but I can't think of any better ways off the top of my head. It certainly seems like it ought to prevent any data loss, and the addition of the prefixes makes it reasonably discoverable behavior even without needing to know about it in the documentation. Would fix the problem for me.

@samuelallan72
Copy link
Author

@sobjornstad yeah ideally we would add something to track the file handles and then clean them up once a sync or note save completed successfully. I can look into it when I get more time.

@casutherland
Copy link

@swalladge Many thanks for taking the time to address this issue. Looks like a great interim approach until we can determine when/how to best safely delete the tmp file. I am running my daily notes off the branch build now.

@samuelallan72
Copy link
Author

Merged to master. I'll cut a new release with this fix soon.

@samuelallan72 samuelallan72 deleted the save-tmp-files branch July 24, 2019 03:20
@samuelallan72 samuelallan72 restored the save-tmp-files branch July 24, 2019 03:21
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

Successfully merging this pull request may close these issues.

3 participants