FAForever / downlords-faf-client

Official client for Forged Alliance Forever
https://faforever.com
MIT License
194 stars 117 forks source link

Pasting a path for the data location can lead to data loss #3158

Closed BlackYps closed 2 months ago

BlackYps commented 2 months ago

Describe the bug The data location under settings > data and caches can be either chosen with the button next to it, or text can be inserted. I first pasted a new path (S:\SCFA Data) into the text field, then realized it is the wrong one because I wanted to go one layer deeper (S:\SCFA Data\FAFData) and chose the correct path with the button. I then saw that the client attempted to copy the data from the old to the new location. This is nice and it would already warrant an issue that you should not be allowed to manually paste a path if using the button triggers additional important functionality.

But to make things worse I noticed data loss. The copy process was hanging (from S:\SCFA Data to S:\SCFA Data\FAFData as reported by the status bar of the client), I pasted the default patch into the text field again before exiting the client. My plan was to start the client again with the default path and then to use the button to properly trigger the process to migrate the files under C:\Program Data\Faforever, but I then realized that the S:\SCFA Data was wiped. There is just the maps and mods folder left. I assume they got recreated because I had set the maps and mods location to that directory a while ago. The mods folder is empty and the maps folder has weird permission issues. My user is not permitted to access it, I'll have to find out how to fix that, before I can confirm if it is empty as well, but I bet it is. ALL other data in that path (I created some more directories there manually) are wiped completely. This auto-copy-and-delete function is way too dangerous to allow pasting arbitrary paths into the text field that don't correctly trigger the process. The only way to change the path should be via the button.

To Reproduce Steps to reproduce the behavior: I hope my explanation was clear enough to reproduce

Log or error message This is my log file: client.log

Expected behavior I expect the client to not delete my private data without warning.

OS Windows