Bug 436871 - Applet may open incorrect session
Summary: Applet may open incorrect session
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: sessions (other bugs)
Version First Reported In: 21.04.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Alexander Lohnau
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-10 14:12 UTC by Eastern Li
Modified: 2022-06-27 07:42 UTC (History)
1 user (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 Eastern Li 2021-05-10 14:12:25 UTC
SUMMARY
If the name of a session contains characters that need to be escaped with %, an incorrect session will be opened when opening it with the applet. 

STEPS TO REPRODUCE
1. With the applet, create a new session and let its name is `%30`.
2. Close the correct session that was automatically opened.
3. Manually open the session `%30` with the applet.

OBSERVED RESULT
Session `0` will be (created and) opened.


ADDITIONAL INFORMATION
For non-ascii chars, such as `test测试` will open `test??`.
Comment 1 Eastern Li 2021-05-13 04:22:20 UTC
I tried editing `addons/sessionapplet/katesessionsjob.cpp`. Replace `QUrl::fromPercentEncoding(dest.toLatin1())` with `dest` on line 62.

Now it seems to be working properly. But I am not sure if the source of the bug is that the function is passed the wrong (not encoded) parameter.
Comment 2 Bug Janitor Service 2022-06-26 08:50:44 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kdeplasma-addons/-/merge_requests/181
Comment 3 Alexander Lohnau 2022-06-27 07:42:57 UTC
Git commit a8c8cba595ca2a2adaa5d38ec9ac1dc0a5e8392c by Alexander Lohnau.
Committed on 26/06/2022 at 08:46.
Pushed by alex into branch 'master'.

Fix percent encoding of kate session file names not being taken into account

M  +2    -1    profiles/profilesmodel.cpp

https://invent.kde.org/plasma/kdeplasma-addons/commit/a8c8cba595ca2a2adaa5d38ec9ac1dc0a5e8392c