Skip to content

Deleting sketch caused Processing to delete my entire Downloads folder (2) #794

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

Closed
processing-bot opened this issue Oct 13, 2023 · 4 comments
Labels
bug Something isn't working critical pde Processing Development Environment

Comments

@processing-bot
Copy link
Collaborator

Created by: chryshbk

Description

I had a sketch from my class opened with a .java file which does not apply to Processing, so I clicked to delete it and it wiped my whole Downloads folder. This issue was raised here (benfry/processing4#424) with the resolution that it would at least send it to the recycling bin then they could still be recovered. However, it wiped all my files entirely instead of sending to the recycling bin.
This is a huge issue and I believe that instead of deleting the file entirely, it should send to the recycling bin since most files are sent to Downloads folder.

Expected Behavior

Send folder to the recycling bin for retrieval (it was made by mistake).

Current Behavior

Wipes the entire folder from the computer.

Steps to Reproduce

  1. Open a sketch from Downloads folder (or any folder
  2. Click to delete it
  3. Click yes
  4. Folder is gone forever.

Your Environment

  • Processing version: 4.3
  • Operating System and OS version: MacOS 11.7.1 Big Sur

Possible Causes / Solutions

I'd say just send it to the recycling bin. Should require password instead of a dialog window if it intends to wipe from the drive at least because it can potentially remove very important files by accident.

@processing-bot
Copy link
Collaborator Author

Created by: benfry

Yikes, are you certain you were using the 4.3 version? It should have given you a message asking if you were sure, and specifically saying “This will delete the "Downloads" folder.”

Also on macOS, it should only be moving to the Trash, so that's a surprise.

@processing-bot
Copy link
Collaborator Author

Created by: JokeGijsbrechts

I also had this issue today !! my full downloads folder is gone 😢😢😢

@Stefterv Stefterv added bug Something isn't working pde Processing Development Environment critical labels Nov 16, 2024
@SableRaf SableRaf moved this to To do in Processing Roadmap Dec 16, 2024
@SableRaf
Copy link
Collaborator

SableRaf commented Feb 5, 2025

Why this happens

When you delete the last tab in a sketch, Processing treats the entire folder containing the .pde file as the sketch folder.

Image

This means that if the .pde file is stored at the root of an important folder (like your Downloads or Desktop folder), deleting it via Processing and confirming the prompt will delete everything in that folder.

Image

Note: to avoid similar issues in existing versions of Processing 4, we strongly recommend keeping your .pde files in their own dedicated folders. This way, deleting a sketch from the PDE will only affect its specific folder and not other important files.

Proposed solution

Given the severity of this issue and the real risk of accidental data loss, I’d like to propose a simple but effective solution: Processing should not allow the deletion of the last tab in any sketch. This approach eliminates the current risk where deleting the last tab causes the entire folder (potentially containing unrelated files) to be deleted.

If a user tries to delete the last remaining tab, Processing would display a message like:
"To delete this sketch, please do so via your file explorer." For added flexibility, an "Open Sketch Folder" button could be included.

While this adds a little bit of friction, it clarifies where the file is located and gives full control to the user. It also helps raise user awareness of the file system, which is especially valuable for beginners.

cc @Stefterv

@SableRaf
Copy link
Collaborator

The proposed solution was implemented in #943 and included in version 4.3.4. Deleting the last tab of a sketch in the PDE will now raise an error message.

Image

Closing this issue.

@github-project-automation github-project-automation bot moved this from To do to Done in Processing Roadmap Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working critical pde Processing Development Environment
Projects
Status: Done
Development

No branches or pull requests

3 participants