f2e-spec icon indicating copy to clipboard operation
f2e-spec copied to clipboard

Errors in folder browser

Open Lord-Kamina opened this issue 2 years ago • 3 comments

Do you want to request a feature or report a bug?

Bug

What did you do?

Tried browsing folders in Windows 10.

What did you expect to see?

  1. Browsing folders and not being able to enter unauthorized folders.

  2. This is just usability but IMO, but navigation could use some improving. Either Escape should go one folder up and only exit the screen if on top level of the hierarchy, or maybe we should set up left and right arrows to go one folder up and down respectively. Might also be a good idea to display folders in a different color.

What did you see instead?

Folders for which I don't have permission (mostly OS shortcuts) not only show on the list, but they are clickable as folders, whereupon performous gives an iterator error, correctly saying permission denied, but then proceeds to change into the folder anyway. Not sure if this could then cause further breakage, with the game thinking it's inside a folder it doesn't actually have access to.

Output of performous --version: (What version of Performous are you using?)

(paste your output here)

What is your environment & configuration (arguments, platform, ...)?

If applicable, please paste the log output in DEBUG level (--logLevel=DEBUG switch)

(paste your output here)

Lord-Kamina avatar Mar 25 '22 11:03 Lord-Kamina

Also linked to this ingame browser: https://github.com/performous/performous/issues/680

There are 2 workarounds:

  1. run performous as admin, which no one should do ;)
  2. Move songs from authorized folder to a folder you have access to and add the path to the config.xml.

Baklap4 avatar Mar 25 '22 18:03 Baklap4

I guess we can use: https://en.cppreference.com/w/cpp/filesystem/directory_options and skip on permission denied errors

Baklap4 avatar Apr 03 '22 12:04 Baklap4

Might be even better to rework this screen as a whole. Like in the opening of this PR stated, The user can still end up in a directory for which he doesn't have permission. A quick flash message shows the error popping up. But after that the screen remains blank. This is not a good user experience.

Ideally we want the following behavior:

  1. Start in $HOME folder
  2. Filter out all directories which gives permission errors
    • This is the tricky part, as we can only determine it by going into the folder. Reading permissions/user/group is not a thing?
  3. Show directory tree to user

This way the user will never be able to accidentally end up in an sort of empty screen and we also did 'tackle' the permission error.

Baklap4 avatar May 06 '22 21:05 Baklap4