Bug 444363 - Copying files to desktop when it's a folder view showing files linked to current activity produces randomly named copies in home folder
Summary: Copying files to desktop when it's a folder view showing files linked to curr...
Status: RESOLVED FIXED
Alias: None
Product: kactivitymanagerd
Classification: Unmaintained
Component: kio (other bugs)
Version First Reported In: master
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Ivan Čukić
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-25 09:55 UTC by Paul Worrall
Modified: 2022-12-29 18:12 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 22.12.1
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Worrall 2021-10-25 09:55:16 UTC
STEPS TO REPRODUCE
1. Configure desktop as a Folder View layout with location set to "Files linked to the current activity
2. Use Dolphin to drag a file to the desktop, choosing "Copy here"

OBSERVED RESULT
1. File does not appear on the desktop
2. A copy of the file appears in my home folder with name changed to a random-looking string of unprintable characters

EXPECTED RESULT
1. File is linked to current activity and so displays on desktop.
2. No copy appears anywhere else

Operating System: KDE neon 5.23
KDE Plasma Version: 5.23.1
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.3
Kernel Version: 5.11.0-38-generic (64-bit)
Graphics Platform: X11
Processors: 2 × AMD A6-6400K APU with Radeon(tm) HD Graphics
Memory: 7.7 GiB of RAM
Graphics Processor: AMD CEDAR
Comment 1 Paul Worrall 2021-10-25 10:14:09 UTC
Actually, expected result 1 is probably wrong as the user would think a copy of the file has been made.  Better if the drop menu said "Link file to current activity" instead of the Move/Copy/Link here options.
Comment 2 Nicolas Fella 2021-10-31 21:57:40 UTC
I can reproduce this with "kioclient5 cp file:///home/user/foo.txt activities:/current/"
Comment 3 alx.kuzza 2022-11-25 21:53:54 UTC
Update, still an issue with an interesting twist.

1) copy a file into an activity view window (folder view or dolphin) , as the result a file with a garbage name is created (this bug), you can check a contents and it matches the source including a timestamp.

2) copy the same file again and a message appears that a target file already exists.

Sounds like a product should be changed to kio-extras.
Comment 4 Nicolas Fella 2022-12-29 13:26:07 UTC
There seem to be multiple layers to this bug.

I don't see any random files in my home folder, but copying/moving/linking doesn't do anything.

In fact the whole activities folder is read-only. "kioclient stat activities:/current/" gives "ACCESS 0500". Looks like a UI bug that it still allows you to try to copy something.

To make linking via dnd actually work one would presumably need to implement WorkerBase::symlink() in the activities worker
Comment 5 Nicolas Fella 2022-12-29 13:55:59 UTC
Somewhat related: https://bugs.kde.org/show_bug.cgi?id=463589
Comment 6 Bug Janitor Service 2022-12-29 14:05:43 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/kio-extras/-/merge_requests/218
Comment 7 Nicolas Fella 2022-12-29 16:37:48 UTC
Git commit 5d7399b594459151e4e9bf6ccbd50d3319385312 by Nicolas Fella.
Committed on 29/12/2022 at 14:02.
Pushed by nicolasfella into branch 'master'.

[activities] Mark worker as read-only

It's not possible to modify anything through this worker, so mark it as not writable

That way UIs like Dolphin know to not enable actions like creating or dropping files

M  +1    -1    activities/activities.json

https://invent.kde.org/network/kio-extras/commit/5d7399b594459151e4e9bf6ccbd50d3319385312
Comment 8 Nicolas Fella 2022-12-29 16:38:33 UTC
Git commit 538222427f4d0a0e5502d9d946170d4f98f1fab9 by Nicolas Fella.
Committed on 29/12/2022 at 16:38.
Pushed by nicolasfella into branch 'release/22.12'.

[activities] Mark worker as read-only

It's not possible to modify anything through this worker, so mark it as not writable

That way UIs like Dolphin know to not enable actions like creating or dropping files
(cherry picked from commit 5d7399b594459151e4e9bf6ccbd50d3319385312)

M  +1    -1    activities/activities.json

https://invent.kde.org/network/kio-extras/commit/538222427f4d0a0e5502d9d946170d4f98f1fab9
Comment 9 Nicolas Fella 2022-12-29 16:43:46 UTC
This "fixes" the issue by preventing any attempt to drop/copy anything into the activities folder.

Implementing that dropping a file links the file to the activity could be a welcome addition, but currently not implemented at all