tomboy-notes / tomboy

This is the legacy development for Tomboy.
http://projects.gnome.org/tomboy
GNU Lesser General Public License v2.1
126 stars 25 forks source link

Lost files due to automatic useage of /Backup files #12

Closed adjenks closed 8 years ago

adjenks commented 8 years ago

I deleted the backups from my .local/share/tomboy/Backup folder because it contained data that i did not want to have on my hard drive and later discovered that tomboy automatically used the contents from the backup folder to fill the .local/share/tomboy folder, thus deleting all of my notes entirely. This made me very sad. I was not expecting it to fill the primary folder with the Backup folder. I expected the Backup folder to be used for things which were accidentally deleted to be MANUALLY recovered in case of emergency. So I've now lost several days of work. My point being: I don't believe the folders are used for their intuitively expected intentions, thus resulting in unintentional data loss. How does tomboy decide to use the Backup folder? Why would it delete everything in my tomboy folder if the Backup folder is empty? In my mind, I removed the Backup and so it should have instead created a new fresh Backup, not delete everything in the main folder.

alex-ter commented 8 years ago

That's definitely an unpleasant experience and one more reminder of importance of having the notes backed up outside of the Tomboy itself.

Just looked through the code and I don't see any place where Tomboy would copy files from backup folder to the main one. It only copies the deleted notes to that dir and from backup to backup folder during a "pre-1.0 to post-1.0" update. I'll try to make an experiment to see if it's just code search not finding the right place.

What Tomboy version is that and what distro?

adjenks commented 8 years ago

hi alex-ter, I'm using Tomboy version 1.15.4 on the newest version of linux mint. It's the version of Tomboy from the mint repo.

davidbannon commented 8 years ago

Hello Adjenks, would that be linuxmint-18-cinnamon-64bit ? Or possibly Mate or the XFCE version ?
I'll bring it up in a VM and see if I can understand whats happened. David

alex-ter commented 8 years ago

Generally window manager should not make any difference in this context, so I think you can try any of them.

adjenks commented 8 years ago

It's the 64 bit cinnamon version of linuxmint. I actually just tried to replicate it myself and couldn't do it. So I'm not sure how it happened. I deleted the contents of the "Backup" folder and then kept using the program, it worked fine for a while, then after I shutdown my computer and turned it back on it only had my most recent note and the primary folder was empty. It makes me wonder if I deleted the whole notes folder. however if I was inside the primary folder and cleared it out with a rm ./* I would have received a msg that said rm: cannot remove ‘./Backup’: Is a directory and I would have realized what I had done. Anyhow, I can't seem to replicate it. I backed up my own copy of the files, deleted the /Backup contents, rebooted and loaded it up, everything was fine. I'll try it a few more times, if I can't replicate it myself I'll close the ticket. Quite strange...

davidbannon commented 8 years ago

OK adjenks, please do some more tests. I will do the same. Lost notes is sufficiently scary that we have a duty of care to test pretty exhaustively - cannot risk some obscure little trap. David

davidbannon commented 8 years ago

Hmm, I have been through a couple of cycles of what I understand adjenks did. And have not been able to replicate the problem. In a clean install, I added tomboy to startup list (hey, note, Tomboy still installed by default in Mint!) rebooted. Then made some new notes, deleted some of them to populate the /Backup. Then from command line removed the files from Backup. Had a short play with the remaining notes, rebooted. Did same thing without looking at remaining notes before rebooting. Then tried delete files and reboot while Tomboy was not running.

I tried what adjenks mentioned, rm ./* in ~.local/share/tomboy instead of in Backup. And confirmed (of course) we get a msg saying cannot remove Backup. But I also realised that that command also leaves the Backup/files in place. Adjenks, after your disaster, the files in ~.local/share/tomboy/Backup were gone weren't they ?

(and a side question, did you have some other backup ? Did you get your notes back ?)

David

alex-ter commented 8 years ago

Thanks David and @adjenks, that pretty much confirms my undertstanding of the code. Tomboy by itself does not try to replace main notes with the backup ones, that's a one-way road.

Let's see if @adjenks is able to reproduce this and if not I think we'd close this one as there seems to be no technical possibility of the app misbehaving here to cause the effect described and as much as I'd wanna help, I just don't see any bugs to fix.

adjenks commented 8 years ago

I can't seem to replicate it. I wish I knew why it happened. I'll close this and make a new post if it occurs again. Yes the files in my Backup folder were gone. I unfortunately did not have another backup.