Bug 508766

Summary: kactivitymanagerd database does not clear its data when "Clear History" is chosen from "Security & Privacy > Recent Files"
Product: [Plasma] plasmashell Reporter: morgon.kanter
Component: Activities in generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: CONFIRMED ---    
Severity: major CC: ivan.cukic, kdedev, nate
Priority: NOR    
Version First Reported In: 6.4.4   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description morgon.kanter 2025-08-26 14:09:48 UTC
SUMMARY
I just created and accessed two files, `test.mp4` and `testfile.tar.gz` as part of reproducing bugs in haruna and ark, respectively. These two programs opened these files and left entries in kactivitymanagerd's database in the process, which can be seen via:

$ sqlite3 .local/share/kactivitymanagerd/resources/database
sqlite> SELECT * FROM ResourceInfo WHERE TargettedResource LIKE '%testfile.tar.gz%';
/home/yourusername/testfile.tar.gz|testfile.tar.gz|application/x-compressed-tar|0|0

...and the same for test.mp4. These were created 20ish minutes ago. If I go to `System Settings > Recent Files > Clear History > Forget the last hour`, it says the activity history has been cleared. However, these entries in the database remain.

STEPS TO REPRODUCE
1. Open any file in ark or haruna (or, likely, any other KDE application that leaves a trace in kactivitymanagerd).
2. Close the application.
3. Attempt to clear history.

OBSERVED RESULT
Database entries are not removed.

EXPECTED RESULT
Database entries should be removed.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.4.4
KDE Frameworks Version: 6.17.0
Qt Version: 6.9.1
Kernel Version: 6.16.2-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-6700K CPU @ 4.00GHz
Memory: 32 GiB of RAM (31.3 GiB usable)
Graphics Processor: NVIDIA GeForce GTX 1080
Comment 1 TraceyC 2025-08-26 21:19:54 UTC
I can reproduce this in git-master