cosmic-files icon indicating copy to clipboard operation
cosmic-files copied to clipboard

Delay in COSMIC Files before displaying files when opening

Open Thatoo opened this issue 7 months ago • 4 comments

Recently, I face a delay (about 5 sec) when I open COSMIC Files before it effectively display files and folders. After opening, I can navigate smoothly and fast.

Thatoo avatar May 06 '25 07:05 Thatoo

I get the same but only with folders with lots of files in them and with most network folders deff noticiable on DAV File Shares. Gnome's File Manager does a lazy loading feature while Cosmic files does not at the moment. Cosmic Files tries to load all files into buffer before it displays them.

johnnyq avatar May 08 '25 17:05 johnnyq

Here is a visual of what is displayed during the 5 sec delay when opening Cosmic Files app :

Image

Once it display all folder and files, then it works nicely and fast but if I close the window and open again later Cosmic Files app then again I have to wait this delay.

Thatoo avatar May 12 '25 07:05 Thatoo

Here are logs if I launch Cosmic Files from Terminal. It seems then linked to the NixOS install :

[2025-05-12T07:08:08Z WARN  cosmic_files::thumbnailer] failed to read directory "/home/USER/.local/share/thumbnailers": No such file or directory (os error 2)
[2025-05-12T07:08:08Z WARN  cosmic_files::thumbnailer] failed to read directory "/nix/store/5ycrr2a710rnni67j9lnv3p4hsz05w93-desktops/share/thumbnailers": No such file or directory (os error 2)
[2025-05-12T07:08:08Z WARN  cosmic_files::thumbnailer] failed to read directory "/home/USER/.local/share/flatpak/exports/share/thumbnailers": No such file or directory (os error 2)
[2025-05-12T07:08:08Z WARN  cosmic_files::thumbnailer] failed to read directory "/var/lib/flatpak/exports/share/thumbnailers": No such file or directory (os error 2)
[2025-05-12T07:08:08Z WARN  cosmic_files::thumbnailer] failed to read directory "/home/USER/.nix-profile/share/thumbnailers": No such file or directory (os error 2)
[2025-05-12T07:08:08Z WARN  cosmic_files::thumbnailer] failed to read directory "/nix/profile/share/thumbnailers": No such file or directory (os error 2)
[2025-05-12T07:08:08Z WARN  cosmic_files::thumbnailer] failed to read directory "/home/USER/.local/state/nix/profile/share/thumbnailers": No such file or directory (os error 2)
[2025-05-12T07:08:08Z WARN  cosmic_files::thumbnailer] failed to read directory "/etc/profiles/per-user/USER/share/thumbnailers": No such file or directory (os error 2)
[2025-05-12T07:08:08Z WARN  cosmic_files::thumbnailer] failed to read directory "/nix/var/nix/profiles/default/share/thumbnailers": No such file or directory (os error 2)
[2025-05-12T07:08:08Z WARN  cosmic_files::thumbnailer] failed to read directory "/nix/store/fjndc5kmxgc1xdasj0pxwr4s6m3kmfg5-cosmic-applibrary-1.0.0-alpha.7-unstable-2025-05-02/share/thumbnailers": No such file or directory (os error 2)
[2025-05-12T07:08:08Z WARN  cosmic_files::thumbnailer] failed to read directory "/nix/store/zdp19w6s9sw7h0kmdha48n65ziqmfrn3-cosmic-settings-1.0.0-alpha.7-unstable-2025-05-02/share/thumbnailers": No such file or directory (os error 2)
[2025-05-12T07:08:08Z WARN  cosmic_files::thumbnailer] failed to read directory "/nix/store/vllzngb58jrlqmpm2nlixhzfrbx79sb6-cosmic-icons-1.0.0-alpha.7-unstable-2025-03-21/share/thumbnailers": No such file or directory (os error 2)
[2025-05-12T07:08:08Z WARN  cosmic_files::thumbnailer] failed to read directory "/nix/store/v20n4npjfwlys7r1n0bh8aa1lg5nb7nb-cosmic-term-1.0.0-alpha.7-unstable-2025-05-09/share/thumbnailers": No such file or directory (os error 2)
[2025-05-12T07:08:08Z WARN  cosmic_files::thumbnailer] failed to read directory "/nix/store/9h3kvq8nbcxvqbg38g31flj68djl4180-cosmic-settings-1.0.0-alpha.7-unstable-2025-05-09/share/thumbnailers": No such file or directory (os error 2)
[2025-05-12T07:08:08Z WARN  cosmic_files::thumbnailer] failed to read directory "/nix/store/vllzngb58jrlqmpm2nlixhzfrbx79sb6-cosmic-icons-1.0.0-alpha.7-unstable-2025-03-21/share/thumbnailers": No such file or directory (os error 2)
[2025-05-12T07:08:08Z WARN  cosmic_files::thumbnailer] failed to read directory "/nix/store/jpfnq8agikgnfkhy7qkz9wzxilrwlm8n-cosmic-files-1.0.0-alpha.7-unstable-2025-05-09/share/thumbnailers": No such file or directory (os error 2)
[2025-05-12T07:08:08Z WARN  cosmic_files::thumbnailer] failed to read directory "/nix/store/9h3kvq8nbcxvqbg38g31flj68djl4180-cosmic-settings-1.0.0-alpha.7-unstable-2025-05-09/share/thumbnailers": No such file or directory (os error 2)
[2025-05-12T07:08:08Z WARN  cosmic_files::thumbnailer] failed to read directory "/nix/store/vllzngb58jrlqmpm2nlixhzfrbx79sb6-cosmic-icons-1.0.0-alpha.7-unstable-2025-03-21/share/thumbnailers": No such file or directory (os error 2)

Thatoo avatar May 12 '25 07:05 Thatoo

This may have been fixed with https://github.com/pop-os/cosmic-files/pull/958. If on a different distro than Pop, the fix will arrive when we tag the next release.

WatchMkr avatar May 14 '25 20:05 WatchMkr

I just tested this again compiling from git master on Arch. Still had the issue until I cleaned out the Trash folder, at which point it worked fine. It contained files on an external file, so I wonder if that had anything to do with it.

fizzyizzy05 avatar May 21 '25 17:05 fizzyizzy05

Indeed, as soon as I empty my Trash folder, Cosmic Files works again very fast and smooth. I can't say if I had files from an external disk in it though, could be.

Thatoo avatar May 21 '25 17:05 Thatoo

Might be the same issue as #823 and connected to #905 .

With internal hard drives (M.2 and SATA) connected, I am still experiencing a ~10s delayed start-up and freezing after the window shows.

Besides freezing after start-up, the freezing regularly reappears when manually or automatically mounting/dismounting the external hard drives. Freezing while mounting/dismounting takes 15s, after that the hard drive is mounted/dismounted and operation resumes normally. In case of start-up, the external hard drives are not displayed in the side column at first, then the freezing happens and after unfreezing the drives appear there.

SammyMcFly avatar May 29 '25 10:05 SammyMcFly

I can confirm that emptying the trash bin resolves the issue. A wild guess: cosmic-files shows a different icon for an empty or a full trash. So maybe on startup it takes time to verify whether the trash is empty or full to decide which icon to display for it.

nabaco avatar Jun 30 '25 21:06 nabaco

Can you test the PR above and let me know if it resolves the issue for you? Thanks!

jorge-menjivar avatar Jul 24 '25 02:07 jorge-menjivar

At first start of cosmic files just after reboot it still takes some time. But after that cosmic files does not freeze on me anymore.

Comments:

As mentioned the delay/freezing had to do with external hard drive being present.

  • Now I get asked for permission (password) before mounting a drive, which did not happen before. This is probably not a bug, but new behavior?!
  • Mounting takes a few seconds when clicking on a hard drive, as expected. But when successfully mounted, the drive's content is not shown. The displayed directory stays the same as before clicking on the hard drive. The directory is only changed, when clicking on the hard drive again after mounting.

SammyMcFly avatar Jul 24 '25 06:07 SammyMcFly

@SammyMcFly unfortunately, the fix above only addresses the issue emerging from the trash bin as observed by @fizzyizzy05, @nabaco, and op.

I have two external drives and thought that was my issue as well, but it turned out to be a misconfiguration related to the trash watcher logic. I didn't find an open issue that resembles the challenges you are seeing, so I recommend opening a new one if you continue to experience the slow start after reboot.

jorge-menjivar avatar Jul 24 '25 12:07 jorge-menjivar