Bug 462334 - kioclient5 ls activities:/current returns mangled file/folder names
Summary: kioclient5 ls activities:/current returns mangled file/folder names
Status: REPORTED
Alias: None
Product: kio-extras
Classification: Frameworks and Libraries
Component: default (other bugs)
Version First Reported In: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-28 00:37 UTC by alx.kuzza
Modified: 2022-12-30 12:32 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description alx.kuzza 2022-11-28 00:37:31 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. run a command kioclient5 ls activities:/current

OBSERVED RESULT
1.  a list of base64 encoded line appears

EXPECTED RESULT
1. list of files or folder names linked to the activity

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: OpenSuSE Tumbleweed
(available in About System)
KDE Plasma Version: 5.26
KDE Frameworks Version: 5.100 
Qt Version: 5.15

ADDITIONAL INFORMATION

Related bug: 

https://bugs.kde.org/show_bug.cgi?id=444363
Comment 1 alx.kuzza 2022-11-28 09:38:23 UTC
To actually see the real values you can use this script:
#!/bin/bash
kioclient5 ls activities:/current | \
xargs -I %% bash -c '
b=$(echo -n %%);
let l=${#b}%4;
if [ $l -ne 0 ] ; then let l=4-$l; fi;
for((i=0;i<l;i++)); do b=${b}=; done;
echo -n $b | base64 -d; echo ""'
Comment 2 Nicolas Fella 2022-12-29 12:52:18 UTC
I'd say this is intentional. What's encoded here isn't just the file name, it's the full path. Plainly appending that won't work because it contains slashes so it would result in a different kind of URL.
Comment 3 alx.kuzza 2022-12-30 02:00:30 UTC
(In reply to Nicolas Fella from comment #2)
> I'd say this is intentional. What's encoded here isn't just the file name,
> it's the full path. Plainly appending that won't work because it contains
> slashes so it would result in a different kind of URL.

kioclient5 ls file:///etc - returns normal file names
we would rather have 
1) normal names returned for activities, those will be absolute paths to the files, which is ok
or
2) maybe we can return names as URLs? like file:///path-to-file
Comment 4 Nicolas Fella 2022-12-30 12:32:05 UTC
Why is it important that the names are human-readable? The activities worker is mostly an implementatio detail, not something the user is expected to interact directly with much