sncli icon indicating copy to clipboard operation
sncli copied to clipboard

New note lost after creation due to connection problem

Open casutherland opened this issue 6 years ago • 6 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?

casutherland avatar Mar 11 '19 14:03 casutherland

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 avatar Jul 19 '19 21:07 sobjornstad

@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).

samuelallan72 avatar Jul 20 '19 00:07 samuelallan72

...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.

samuelallan72 avatar Jul 20 '19 00:07 samuelallan72

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.

sobjornstad avatar Jul 20 '19 13:07 sobjornstad

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. :)

samuelallan72 avatar Jul 22 '19 00:07 samuelallan72

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

casutherland avatar Jul 24 '19 02:07 casutherland