Deleted files can be recreated by saving an already-open editor tab
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
- Open the Pterodactyl panel and go to the File Manager.
- Create a new file (for example: test.txt).
- Open the file and keep it open in the editor.
- While the editor tab is still open, delete the file from the File Manager.
- Return to the editor tab and click Save.
- Observe that the file is recreated automatically.
Additional case:
- Create a directory (e.g. config/) and a file inside it.
- Open the file in the editor.
- Delete the file or the entire directory.
- Save from the still-open editor tab.
- 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.
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.
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?
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
And regarding what you said about “someone else modified this file already,” that would be quite good
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.
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.