Certain Marta operations can lead to data loss
Hello,
First of all, this is great software. I'm a bit worried because the project seems to be getting stale as of late. Yan, if you're reading this, I hope you are alright.
I've spotted the two following scenarios that can lead to data loss. There might be additional scenarios where this happens, but I have not tested more. In both cases, an existing file gets overwritten without any kind of prompt or error.
- Using the
rename()function through Lua (and I suspect any other way). If we add the path of a file that already exists, the function will silently overwrite the existing file. Instead, I would expect therename()function to throw a warning/error and stop. - Using Marta's UI, if we create a new file (in my case I used the context menu), if a file with the same name already exists in the same location, it actually gets overwritten by the new empty file instead of displaying an error.
I think that due to the severity of this, every part of renaming, moving, creating new files etc of the application should be inspected to make sure that this is not possible anywhere else. Also, writing some related tests would protect from any possible future regressions.
eep. had no idea about this one! thanks for pointing it out. I also hope Yan will make contact soon enough - even just to touch base!
I can confirm creating a the new file with same name as an existing one creates a blank file, overwriting the old one without notice. In my case I created a new file via keyboard shortcut (⎇ Option + ⌘ Command + n)
Marta 0.8.1 - MacOS 12.6 (21G115)
You can add one more operation to the list that deletes the whole folder! https://github.com/marta-file-manager/marta-issues/issues/996
@yanex - if I may, this should be marked as major bug
Data loss is serious issue for file manager - any plans to fix this?