Bug 497434 - Applying view properties to home directory and its subfolders causes recursion with ~/.local/share/dolphin/view_properties/local folder
Summary: Applying view properties to home directory and its subfolders causes recursio...
Status: CONFIRMED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 24.12.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-13 22:50 UTC by Łukasz Konieczny
Modified: 2025-01-09 19:41 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Monstrous amount of reported subdirectories in Dolphin during the operation of changing view properties (274.88 KB, image/png)
2024-12-13 22:50 UTC, Łukasz Konieczny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Łukasz Konieczny 2024-12-13 22:50:35 UTC
Created attachment 176587 [details]
Monstrous amount of reported subdirectories in Dolphin during the operation of changing view properties

SUMMARY
After update to KDE Gear 24.12, I have noticed new default view properties to show thumbnails even in system directories, like / and /usr/lib/
I wanted to change that. I commanded Dolphin to apply new default view properties to not show thumbnails. I didn't work. All directories, be it system or directories in /home/, still showed thumbnails. Then I tried to change view properties in / and all its subdirectories. It took monstrous for this operation amount of time, notably half an hour, and Dolphin showed, that / has about 2 000 000 subdirectories, which is impossible, because I know, that even number of files in / is equal to about 600 000, so this filesystem can't have 2 000 000 items. Then, when this operation finished, I checked my home directory. It still had thumbnails enabled (and showing directories first, which I dislike). So I repeated the operation for my home directory. This time Dolphin showed about 8 000 000 subdirectories, which is way more impossible. This operation already lasts 45 minutes, while I'm writing this bug report.

STEPS TO REPRODUCE
1. Try to change default view properties or change view properties for the directory subtree.
2. Observe the result.

OBSERVED RESULT
No result of changing default properties. Long time of changing properties for subtrees.

EXPECTED RESULT
Everything works for short time, number of subdirectories is accurate, when I want to change default view properties, this properties are applied to all directories without explicitly changed properties.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.1
Kernel Version: 6.12.4-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i5-1135G7 @ 2.40GHz
Memory: 31.2 GiB of RAM
Graphics Processor: Mesa Intel® Iris® Xe Graphics
Manufacturer: System76
Product Name: Darter Pro
System Version: darp7

ADDITIONAL INFORMATION
Comment 1 Łukasz Konieczny 2024-12-14 11:47:31 UTC
Similar problem with directory counting is in Filelight. And in Properties dialog window in Dolphin. Counting subdirectories never finishes.
Comment 2 Paul Worrall 2024-12-14 15:58:14 UTC
Looks like two separate bugs:
1. For the setting of default view properties: Already reported, see bug #495878
2. For the number of subdirectories, could it be something like a sub-folder containing a symbolic link to one of its parents (i.e. a loop)?  What does `find $HOME -type d | wc -l` report for the number of sub-folders?
Comment 3 Łukasz Konieczny 2024-12-14 16:45:27 UTC
(In reply to Paul Worrall from comment #2)
> Looks like two separate bugs:
> 1. For the setting of default view properties: Already reported, see bug
> #495878
> 2. For the number of subdirectories, could it be something like a sub-folder
> containing a symbolic link to one of its parents (i.e. a loop)?  What does
> `find $HOME -type d | wc -l` report for the number of sub-folders?

I executed your command and I do have such amount of subdirectories. But I don't have in my backup on external drive! So I did an investigation and found, that almost all of these subdirectories are stored in /home/panlukasz/.local/share/dolphin/view_properties/local/home/panlukasz/.local/

This is inception! Bug in Dolphin! When I tried to change view properties in my home directory, Dolphin tried to change these properties also in hidden directories, including directory, in which it stores information about view properties. So it created directory structure for ~/.local/ in ~/.local/share/dolphin/view_properties/local/home/panlukasz/
And it did so recursively, making very deep directory structure
Comment 4 Bug Janitor Service 2024-12-29 03:47:23 UTC
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 5 Akseli Lahtinen 2025-01-09 19:32:13 UTC
Ah, I see what you mean. I think I can sort of repro it.

1. Open home folder
2. Configure dolphin -> view -> remember display style for each folder, then press ok
3. Adjust view display style for home folder
4. Set it to folders and subfolders, change view mode to something different, then click on "set as default"
5. You get a popup that counts a lot of folders

How this system works is that in `~/.local/share/dolphin/view_properties/local/` we create folders for each folder that has their settings changed. So it does this recursively until the end of time because it keeps going to this folder as well, which should practically be off-limits to these settings.

I think the solution is to disallow changing view properties in any folder inside `~/.local/share/dolphin/view_properties/local/` when running the "set view properties" setting.