insanum / sncli

Simplenote CLI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New note lost after creation due to connection problem

casutherland opened this issue · comments

After creating a new note, there was apparently an internet connection issue and the note was never saved, locally or remote. Complete data loss.

Perhaps, we need to visit the local temporary persistence (store and forward) mechanism, in order to further reduce data loss in the event of a network disconnection?

Just want to say I've experienced similar issues where sncli locks up when I save and exit my editor, and the content is lost. I've had to start writing out a backup copy before leaving my editor if I've made major changes. I would like to see sncli place the temporary file in a location where it will be saved if anything untoward happens.

@sobjornstad

I would like to see sncli place the temporary file in a location where it will be saved if anything untoward happens.

The temporary file location is customizable with the cfg_tempdir option, so you can set it to a persistent location if you like. By default it is /tmp/, so if sncli has crashed, you can still recover the note (unless the OS has rebooted).

...although it probably would be good to investigate when these tempfiles are deleted by sncli - it would be good to have them around for longer.

Hmm, I seem to remember looking for it in /tmp and not finding it, but the last time I tried was a while ago. I'll take a closer look if it happens again.

I'm treating this as a high priority bug now. Data loss is no joke and this has affected enough people now. Obviously it is possible for the temporary file to be removed before a note is successfully saved in sncli's database or synced. I'll aim to look into it when I have time this week. If anyone else can see where the issues are and would like to open a WIP pull request or comment here, that would be appreciated. :)

Thanks. Running the branch PR #90 locally now, and already appreciating the increased reliability.