Bug 466416 - KDE Connect floods kio places (user-places.xbel) with a ton of entries of the same device causing overall desktop performance degeneration.
Summary: KDE Connect floods kio places (user-places.xbel) with a ton of entries of the...
Status: RESOLVED DUPLICATE of bug 461872
Alias: None
Product: kdeconnect
Classification: Applications
Component: common (show other bugs)
Version: 23.04.1
Platform: Neon Linux
: VHI normal
Target Milestone: ---
Assignee: Albert Vaca Cintora
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-25 17:49 UTC by Andrei Rybak
Modified: 2023-09-15 23:13 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Unusable Dolphin due to overlong "Devices" section in the panel "Places" (272.56 KB, video/mp4)
2023-02-25 17:49 UTC, Andrei Rybak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Rybak 2023-02-25 17:49:25 UTC
Created attachment 156717 [details]
Unusable Dolphin due to overlong "Devices" section in the panel "Places"

SUMMARY
The section "Devices" in Dolphin becomes unusable, because KDE Connect keeps adding a new line to the section "Devices", it seems, every single time the phone is connected to the computer.

STEPS TO REPRODUCE
1. Use KDE Connect for a prolonged period of time, make sure that the phone(s) connect and disconnect from the network that PC is on multiple times.
2. Open Dolphin.
3. Unhide the section "Devices" in the "Places" panel.

OBSERVED RESULT
Watch the screen recording please.

EXPECTED RESULT
Something sensible, that doesn't require you to scroll for how long the video is.

SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.27
KDE Plasma Version: 5.27.1
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Kernel Version: 5.19.0-32-generic (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i5-8250U CPU @ 1.60GHz
Memory: 7.7 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620
Manufacturer: Dell Inc.
Product Name: Inspiron 5570

ADDITIONAL INFORMATION
Right now there is no simple way to delete these phantom entries from Dolphin interface in a fast way. I will also create a Dolphin bug to add a feature to delete the devices from this panel faster.
Comment 1 Andrei Rybak 2023-02-25 17:52:20 UTC
> $ apt show kdeconnect 2>/dev/null | head -2
> Package: kdeconnect
> Version: 22.12.2-0xneon+22.04+jammy+release+build21
Comment 2 Andrei Rybak 2023-02-25 18:20:14 UTC
> ADDITIONAL INFORMATION
> Right now there is no simple way to delete these phantom entries
> from Dolphin interface in a fast way. I will also create a Dolphin bug
> to add a feature to delete the devices from this panel faster.

Created new bug: https://bugs.kde.org/show_bug.cgi?id=466420
Comment 3 Andrei Rybak 2023-02-25 18:24:00 UTC
In the video, one can see that the name of the phantom entries in the list is different for the last couple of dozen items — that's roughly the number of days that I've had a new phone that connects to the same computer via KDE Connect.
Comment 4 zacharytalis 2023-02-25 21:44:10 UTC
I'm also experiencing this bug (same software versions but on Arch Linux). My phone's a Samsung Galaxy S10, in case that's relevant.

For the time being, you can prune these spam entries by editing "~/.local/share/user-places.xbel" directly. (make sure to be careful and take a backup, yada yada)
Comment 5 Andrei Rybak 2023-02-25 22:03:49 UTC
(In reply to zacharytalis from comment #4)
> For the time being, you can prune these spam entries by editing
> "~/.local/share/user-places.xbel" directly. (make sure to be careful and
> take a backup, yada yada)

It would have taken me a looong time to figure out where this is being stored. Thank you for saving my sanity when using Dolphin and my time!
Comment 6 Andrei Rybak 2023-02-26 10:56:11 UTC
(In reply to zacharytalis from comment #4)
> you can prune these spam entries by editing "~/.local/share/user-places.xbel" directly.

More instructions for manually cleaning up "~/.local/share/user-places.xbel" in the Dolphin ticket: https://bugs.kde.org/show_bug.cgi?id=466420#c3
Comment 7 Jose Rivero 2023-05-20 13:09:57 UTC
I had the same problem.

I think the root cause is that the device uses MAC randomization, so every time it connects with a different MAC address, a new entry will be created.
Comment 8 Andrei Rybak 2023-05-23 21:54:54 UTC
Jose, thank you for the insight. I will try disabling the MAC randomization on the phone and see if it helps.

What is very surprising, however, if it is indeed the root cause, is that KDE Connect itself doesn't seem to be confused by the MAC address randomization. Regardless of the MAC address, KDE Connect seems to be able to keep track of the "trusted" status of the phone and of all the settings of plugins (e.g. the commands in "Run commands").
Comment 9 Till Schäfer 2023-05-28 11:19:39 UTC
I can confirm this issue on Gentoo. 

I am raising the importance to VHI, since this made my whole desktop feel broken. Open dialogs, dolphin, krusader, gvewnview and other apps took about 20 seconds to open  with very cpu load (also  see Bug 451876). Editing the places panel in dolphin or somewhere else caused the whole desktop to freeze for a minute or so on relatively modern hardware.  For a non-sophisticated user, this may render the complete desktop unusable, maybe ditching plasma at all. 

Moreover, since MAC randomization is the standard nowadays, this will affect almost all kdeconnect users after some time.
Comment 10 Till Schäfer 2023-05-28 11:42:09 UTC
I think the solution here should embrace the following two aspects: 
* avoid adding the same device multiple times (e.g. by updating an existing entry and not adding a new one)
* clean old devices that are no longer used by kdeconnect
Comment 11 Andrei Rybak 2023-09-14 08:23:12 UTC
An important discovery has been made thanks to Albert Vaca in the related ticket. Quote from https://bugs.kde.org/show_bug.cgi?id=461872#c11 :

> I found a problem in the related ticket https://bugs.kde.org/show_bug.cgi?id=466416 --
> the steps to reproduce there aren't precise enough. Step 3 is "3. Unhide the section
> "Devices" in the "Places" panel.", but on the video recording attached to that ticket
> checkbox "Hide section 'Devices'" is enabled and I am using checkbox "Show All Entries"
> to make the overflowing section 'Devices' visible.
Comment 12 Albert Vaca Cintora 2023-09-15 23:13:42 UTC
We should be able to fix this before the next release. Let's centralize this in bug 461872, marking this one as duplicated.

*** This bug has been marked as a duplicate of bug 461872 ***