Bug 511714

Summary: Deleted file is still shown in Recent Files in Places - History
Product: [Plasma] plasmashell Reporter: luca <luca.pedrielli>
Component: Application Menu (Kicker) widgetAssignee: Plasma Bugs List <plasma-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: cwo.kde, kdedev
Priority: NOR    
Version First Reported In: 6.5.1   
Target Milestone: 1.0   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Error Message
Still present with Plasma 6.5.3
Recent Files List
error in kdeneon
error video in kdeneon live

Description luca 2025-11-06 14:03:27 UTC
Created attachment 186542 [details]
Error Message

SUMMARY
If I try to open a no more existent file in Kicker->Recent Files I receive an error messagews that says:
WorkingDirectory= expects an absolute path or '~ 

STEPS TO REPRODUCE
1. Create a text file
2. Open it
3. Delete it 
4. Open it in Recent Files

OBSERVED RESULT
Strange message "WorkingDirectory= expects an absolute path or '~"

EXPECTED RESULT
A message that says "The file xxxxx does not exit" as it was in plasma 6.3

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debia Testing/Sid
KDE Plasma Version: 6.5
KDE Frameworks Version: 6.18.0
Qt Version: 6.9.2
Comment 1 TraceyC 2025-11-25 21:14:09 UTC
I'm not able to reproduce this on Plasma 6.5.3 or built from git-master

Steps to reproduce:
1. Create a test file and open it, close it again
2. Verify it can be reopened via Application Menu by searching for the file name
3. Delete the file on disk
4. Search for it in Application Menu

The file name is no longer found
So you still see this bug with Plasma 6.5.3 or later?
Comment 2 luca 2025-11-26 07:47:27 UTC
Created attachment 187184 [details]
Still present with Plasma 6.5.3

Still present with Plasma 6.5.3
Comment 3 luca 2025-11-26 07:56:04 UTC
Created attachment 187185 [details]
Recent Files List

The deleted file Text File(1).txt is still present in Recent Files List
Comment 4 luca 2025-11-26 09:53:52 UTC
in journal:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
nov 26 10:51:46 user plasmashell[6624]: kf.kio.gui: Failed to launch process as service: "app-org.kde.kate@9b377cba6efe438590196a4326d9f1bf.service" "org.freedesktop.DBus.Error.InvalidArgs" "WorkingDirectory= expects an absolute path or '~'"
nov 26 10:51:46 user plasmashell[6624]: QQmlVMEMetaObject: Internal error - attempted to evaluate a function in an invalid context
nov 26 10:51:46 user plasmashell[6624]: file:///usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/ui/main.qml:260: TypeError: Property 'modelIndex' of object Task_QMLTYPE_638(0x55a198040450) is not a function
Comment 5 luca 2025-11-26 10:22:10 UTC
Created attachment 187187 [details]
error in kdeneon

I can reproduce the error in latest kdeneon with plasma 6.5.80
Comment 6 luca 2025-11-26 15:32:40 UTC
Created attachment 187191 [details]
error video in kdeneon live
Comment 7 TraceyC 2025-11-26 17:39:27 UTC
Thanks for the screen recording. That shows more clearly how to reproduce the bug. Using those steps, I can reproduce this in git-master.
Also, thanks for the logs, they are also helpful.

Dolphin - create ~/Text File.txt (in my testing, you can also create a file from command line)
Application Menu - Places - History - click on the text file
In Dolphin, Right click - delete - see warning "The trash is not available for this item's location. Permanently delete it instead?", do that. (Or, delete on command line)
After this, the file is still in Application Menu - Places - History
Clicking it produces the error

So it seems there are two interconnected things happening.
1. The file is not being removed from Places - History
2. Trying to open a deleted file should produce a more accurate and human friendly message
Comment 8 cwo 2025-11-29 23:22:21 UTC
The bad error dialog is fixed by https://invent.kde.org/frameworks/kio/-/commit/e2ffb5199d54a27f8cdae69f6787fb2535097938.

The fact that missing files appear in the Recent Files list in the first place is, I think, another variant of bug 503840 - the database removes the file the first time it gets to that entry, but the Application Menu somehow does not detect this update while it's running. If you restart Plasma, the entry for the file will be gone.

Last time I looked at this I couldn't quite figure out what was broken, but I'll try again soon.

*** This bug has been marked as a duplicate of bug 503840 ***
Comment 9 cwo 2025-12-01 01:01:25 UTC
I now think I know what's wrong with 503840; they're not completely unrelated but not the same issue and the fix for that one doesn't solve the deleted files sticking around.

They will be deleted if a model looks at them, but that can sometimes take a while - a plasma restart will do it, or refreshing Dolphin's Recent Files view. I'll think about whether we can do something on the kicker backend side.

(Also, the title talks about "Places - History", and that doesn't exist in Application Menu, only in Application Launcher. They use the same backend, but do things differently so what applies to one may not apply to the other, especially for Recent Files. I'll leave it here as Kicker has a similar issue, but it may need to be fixed in both).