Dvlv / BoxBuddyRS

A Graphical Interface for Distrobox
MIT License
229 stars 24 forks source link

Appears stuck if no applications installed in a distrobox #12

Closed atimeofday closed 7 months ago

atimeofday commented 7 months ago

Minor UI bug:

Although the "View Applications" button works great in a box with applications installed, I have boxes where it hangs on the loading screen the first time, and has to be clicked and closed multiple times before displaying that no applications are installed.

I just read through the code, found the function which that button should be attached to, and tried manually running the shell command which searches for installed packages

grep -L \"NoDisplay=true\" /usr/share/applications/*.desktop

Surprisingly, this showed precisely one application installed in one of the boxes where the bug occurred. I dug through the next few lines of code in the distrobox handler:

for line in desktop_files.split('\n') {
        if line.is_empty() || line.contains("No such file") {
            continue;
        }

Note: I do not know Rust. I suspect that there is an edge case in this check where a list with a single item instead of an empty string and no newline character is not handled. However, I don't recognize the app which the grep above listed, so it may be rightly filtered out, and the loading screen hang could be caused by something else.

Dvlv commented 7 months ago

Thank you for the bug report. What is your host distro, and do you know what distro you were using for the Box?

atimeofday commented 7 months ago

Bazzite-gnome-nvidia:testing (read: Fedora Silverblue 39). I had two Fedora 39 boxes where one displayed 3 apps correctly and the other had no added apps and this issue. I can do more testing probably within a few days at most; let me know what information would help!

Dvlv commented 7 months ago

Managed to recreate this once, and never again, but luckily I got a peek at the error message, so a fix should be available in 1.0.10, which is making its way to Flathub now.

atimeofday commented 7 months ago

Gotcha, interesting, sounds good! I'll keep an eye on it and try to report back :)

Dvlv commented 7 months ago

I'll close this one, but if you still get the issue feel free to re-open (or raise another).