panel icon indicating copy to clipboard operation
panel copied to clipboard

Deleted files can be recreated by saving an already-open editor tab

Open voidvalue-dev opened this issue 11 months ago • 6 comments

Current Behavior

When a file is opened in the Pterodactyl file editor and then deleted while the editor tab remains open, the file can be unintentionally recreated.

This also occurs with files located inside subdirectories. Even after deleting the file (or its parent directory), the editor still allows saving, which recreates the file and, if necessary, the directory structure.

https://github.com/user-attachments/assets/a327e9fa-3478-4bd0-b7ab-87202205e2d3

Expected Behavior

Once a file (or its parent directory) is deleted, any open editor tab for that file should become invalid.

The panel should either: Prevent saving and display an error indicating that the file no longer exists.

Under no circumstances should a deleted file or directory be recreated by saving from an open editor.

Steps to Reproduce

  1. Open the Pterodactyl panel and go to the File Manager.
  2. Create a new file (for example: test.txt).
  3. Open the file and keep it open in the editor.
  4. While the editor tab is still open, delete the file from the File Manager.
  5. Return to the editor tab and click Save.
  6. Observe that the file is recreated automatically.

Additional case:

  1. Create a directory (e.g. config/) and a file inside it.
  2. Open the file in the editor.
  3. Delete the file or the entire directory.
  4. Save from the still-open editor tab.
  5. The file (and directory, if deleted) is recreated.

Panel Version

1.11.11

Wings Version

1.11.13

Games and/or Eggs Affected

No response

Docker Image

No response

Error Logs


Is there an existing issue for this?

  • [x] I have searched the existing issues before opening this issue.
  • [x] I have provided all relevant details, including the specific game and Docker images I am using if this issue is related to running a server.
  • [x] I have checked in the Discord server and believe this is a bug with the software, and not a configuration issue with my specific system.

voidvalue-dev avatar Dec 26 '25 17:12 voidvalue-dev

I don't know if this is intentional or not, but I don't see much point in it either. Because normally, if you want to recover something you've deleted, it's several things in a directory and not just one directory.

voidvalue-dev avatar Dec 26 '25 17:12 voidvalue-dev

This is intentional behavior — the editor has no concept of existence in the flow and just sends the data to Wings and lets it determine if the file is there or not. We'd have to come up with some logic to send along a timestamp of when the file was opened, and then have Wings block the request if the file was modified since then.

I'm not really sure I want to change this behavior — its kinda edge-case-y?

DaneEveritt avatar Dec 26 '25 17:12 DaneEveritt

Thanks for the explanation. I understand this is edge-case-y, but in multi-user environments, it’s possible for one person to delete a file while another still has it open. I think the editor should at least display a message warning that the file no longer exists, instead of silently recreating it

voidvalue-dev avatar Dec 26 '25 17:12 voidvalue-dev

And regarding what you said about “someone else modified this file already,” that would be quite good

voidvalue-dev avatar Dec 26 '25 17:12 voidvalue-dev

Yeah -- maybe this makes more sense if we step back one and just add a feature to throw a warning if the file was modified (including deleted) between open and the user hitting save.

DaneEveritt avatar Dec 26 '25 17:12 DaneEveritt

I'm closing this out as it is not a bug in its current state. Please feel free to open a Discussion regarding the feature to alert to changes to the file state while editing.

DaneEveritt avatar Jan 04 '26 23:01 DaneEveritt