Deleted Items - Why don't they go to trash?

Asked by Max Hyatt

It looks like I made a huge mistake. I installed Variety for the first time last night, and got it working properly. I was browsing through all the settings when I clicked the "Download a wallpaper every 10 minutes" folder picker, and accidentally changed it to my Pictures folder. Big mistake. Again, I didn't notice it was changed, I believe Variety stated it was going to uncheck "limit download folder to 500 MB", which I checked again. Again, big mistake.

Now my pictures' folder is EMPTY. Completely wiped. Variety should move items to the TRASH, and let the user clear it manually. Variety traversed every subdirectory of my Pictures folder and deleted every image file! This should not be done automatically.

For the most part, I have a backup of my personal pics that were there (well over 2 GB), but all the wallpapers, screenshots, and smartphone pictures I stored in my Pictures' folder are gone.

Once I noticed what had happened, I immediately shut off my PC and launched a live CD which had PhotoRec on it. Unfortunately, it was unable to locate any images which were deleted (possibly because I'm on an SSD).

Some suggestions:

1. Warn the user that it is about to delete photos, regardless of if they are downloaded from the web or locally stored.
2. Don't auto-delete at all. Inform the user that the folder is reaching the limit and let them handpick which items to delete.
3. If auto-delete is to stay around, move items to the TRASH. No app should delete any user files without user intervention.
4. If user does select personal Pictures folder (home/USERNAME/Pictures), limit download folder should not be able to be checked.

Again, this is somewhat my fault. I definitely should've tested this app on another computer/test environment before using it on my primary. But, auto-deletion is not cool.

Question information

Language:
English Edit question
Status:
Solved
For:
Variety Edit question
Assignee:
No assignee Edit question
Solved by:
Max Hyatt
Solved:
Last query:
Last reply:
Revision history for this message
Peter Levi (peterlevi) said :
#1

First, I'm really sorry this has happened to you. Still, Variety does show a warning and also auto-unchecks the limit option when you change the download folder, and also the limit option has a "CAUTION" tooltip warning for exactly this case.

Still, if it has happened to someone, it will happen to others so this obviously needs fixing. Let's see how.

1. Not an option - if the user keeps the default download folder (and the majority of users do), they will get regular unnecessary confirmation dialogs.

2. Same as above. Users should not hand-pick within what is an automatically managed folder.

3. Maybe better to move to Trash. I have considered it before.... The problem with this is that if the user reduces the download interval to say, 1 minute (and many people do), Variety can generate huge amounts of data - e.g. around 60 mb per hour, more than 1 GB/day. This would constantly fill the Trash folder, causing the OS to purge it regularly thus removing from it potentially much more useful data then automatically-downloaded pictures.

I don't agree deleting happens without user intervention - you have to change two options in the settings to have it this way.

4. Does not solve the problem. User can have valuable data anywhere... We may probably allow the limit ONLY when the downloaded folder is the default one. Or at least have a confirmation message when enabling again, warning of what the consequences are.

I'll definitely reconsider deleting to trash, but now your story has made me reconsider the need for configuring the auto-download folder altogether. Maybe it should be set to the default folder without giving the user an option to change it from the GUI, only via the config file.

Again, I'm sorry for the lost files. I thought the precautions against data-loss were enough in this case, but obviously not. Did you try some other undelete tool like http://extundelete.sourceforge.net/? Variety uses os.unlink calls to remove the files which should not immediately wipe the data, only the file entry in the filesystem.

Revision history for this message
Max Hyatt (mystamax) said :
#2

hooray, i found backups of all my pictures! I was able to restore all my stuff, so I'm good now.

First, Thank you for taking the time to answer my question.

It was completely my fault for not paying attention to the warnings you put in place.

Before remembering where my backups were, I tried extundelete. Didn't get too far w/ the one in the repos, so I compiled it from source and that was able to recover so other files from the Pictures directory, but nothing I needed. Thank you for the suggestion. Learned a lot using extundelete.

While using the app more, i thought of some other suggestions. One is similar to the one you just fixed in the attached bug report.

Other suggestions:

1. Maybe a notification bubble to state items were moved to trash or deleted?

2. Maybe a checkbox option to move items to trash instead of completely deleting? Warn them of consequences of this. Maybe this can stay out of the GUI as well, and be a config file only option.

3. I agree that removing the auto-download folder from the GUI may be a good idea.

4. If /home/$username/pictures is selected, only delete from variety created directories? keep those a user selects as favorites.

5. Don't download/switch wallpaper when screen is idle (screensaver is enabled).

I think I know how the original problem was created. The folder picker (regardless of app) sometimes acts weird, opening & closing very fast. I think it picked the Pictures folder, and then I rechecked the limit option, not paying full attention to what had just occurred.

Again, thanks for taking time to create the app, and working with your users to make it better. Awesome dev!

Revision history for this message
Peter Levi (peterlevi) said :
#3

I'm really glad to hear you have managed to get back your files, I really did feel bad for having been the root of a major data loss, even if it wasn't entirely Variety's fault - it has happened to me as well and I know it is a major pain in the ass. I remember vividly the one time when the installer of one of Ubuntu's betas completely wiped out my whole partition table while still in the phase of checking what the partitions are - I hadn't even confirmed that any actions should be performed (a lot of people got burned by this). Several sleepless nights of using various hacky tools to recover the partition table....

I agree the folder picker is weird. I noticed several different major usability issues with it. I think Gnome has degraded in this aspect - it is now too easy to select the wrong folder even when paying attention.

Regarding the suggestions - I think the current behaviour (after the last commit) is pretty safe - if the folder the user chooses is out of Variety's config folder, Variety uses a subfolder "Downloaded by Variety" instead of the one the user specified and all file and folder creation, purging of older downloads, etc. happens within it, so there is no chance to delete valuable user files (unless the user happens to have valuable files in a folder named exactly that way, but this is completely improbable). I.e. Variety simply does not allow you to download directly into some arbitrary folder, it requires a folder for itself and works only within it. This may lead to some minor upgrade issues for a number of people who have modified the defaults (they'll have to manually move the existing files into the subfolder), but is obviously necessary in the long run.

I would like to avoid having to move to trash or showing a notification when purging for one major reason - Variety is a background application that should stay maximally out of the way and filling the disk (even with files in Trash) or constantly notifying the user of events that happen regularly and automatically are both somewhat intrusive (filling the disk is very intrusive actually).

5) This is a different issue, I'll need to check if detecting of idleness is something universal among DEs or every DE has a different approach - I really hate having to code DE-specific functionality (setting the wallpaper was one), as this leads to a support nightmare.

Regards, again, I'm very glad to hear you recovered the lost data.

Revision history for this message
WQ (william222) said (last edit ):
#4
Revision history for this message
WQ (william222) said :
#5