minigalaxy icon indicating copy to clipboard operation
minigalaxy copied to clipboard

Filesys utils

Open makson96 opened this issue 4 years ago • 3 comments

This is to fix #218 Well it took me much longer that I was expecting, but I think that this module is now ready for broader testing and comments.

Basically this module will replace destructive files operations (write, move, remove, copy) with operations, which would double check if any important user files are not affected. This module has some possibilities to introduce regressions which should be detected before merge, but what is most important, users files should be safe now.

makson96 avatar Jan 25 '21 18:01 makson96

Thanks for the PR. I've finally found the time to test this. I did find an issue with it, though. It seems updating doesn't work with it at the moment. I'm seeing this error:

Screenshot from 2021-02-06 13-52-03

sharkwouter avatar Feb 06 '21 12:02 sharkwouter

  • The issue you mentioned (with updates) is already addressed in this branch.
  • Branch is updated with current master
  • Changes in master in regard to files operation are addressed here.

It is ok. I know this seems to be big change so we have time to shape it, so it addresses all worries regarding files operations.

At the moment the main thing which this pull request does is during destructive files operations:

  • check if we are performing operation only in directory in white list, what includes only:
json_config["install_dir"], CONFIG_DIR, CACHE_DIR
  • standard user directories are on the blacklist. So even if due some misconfiguration, we end up with "install_dir" being "/home/user/Documents", this "Documents" directory won't be removed during for example game uninstall.
  • We got a little more control. For example Python by default overwrites files. With this pull request we overwrites files only if we specifies so (this was the cause of issue you mentioned with updates).
  • If we do something incorrect, instead of Python exception, this module return error message, which can be displayed to the user (as on the screen you show).

If you have other suggestions how to improve safety here, please let me know

makson96 avatar Feb 07 '21 09:02 makson96

Lets convert it to the draft and check if we can make easier solution.

makson96 avatar Apr 14 '21 06:04 makson96

I'm going to close this for now, since I think it doesn't fit that well into the current state of Minigalaxy. We should look into a different solution once I'm done with refactoring.

sharkwouter avatar Sep 25 '22 22:09 sharkwouter