Bug 433932 - Bluetooth system tray mouseover sometimes shows wrong device
Summary: Bluetooth system tray mouseover sometimes shows wrong device
Status: RESOLVED DUPLICATE of bug 422691
Alias: None
Product: Bluedevil
Classification: Plasma
Component: general (show other bugs)
Version: 5.20.5
Platform: Debian testing Linux
: NOR minor
Target Milestone: ---
Assignee: David Rosca
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-04 00:15 UTC by Joel Ray Holveck
Modified: 2021-04-05 21:27 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joel Ray Holveck 2021-03-04 00:15:26 UTC
I haven't worked out specific steps-to-reproduce, since I don't know how to make a simple repro case for something that relies on Bluetooth devices.

I currently have two BT devices paired with my computer: an "Intuos BT M" tablet, and a "Nvidia Controller v01.04" gamepad.  The tablet is rarely connected, but the gamepad usually stays connected for long periods, including reboots.

Often, if I hover my mouse over the Bluetooth icon in the KDE System Tray, it will say "Bluetooth: Intuos BT M connected" (referring to the tablet), even though only the gamepad is connected.  If I click on the Bluetooth icon, the list of devices correctly puts the gamepad under "Connected" and the tablet under "Available"; the only place I see the wrong device is in the mouseover.  It doesn't seem to affect anything concrete.

I think (but haven't been able to verify formally) that it almost always is wrong when I start the computer; however, if the gamepad disconnects and later reconnects, then the mouseover stays correct for the remainder of the session.

This is using the default Bluetooth system tray icon, the one that shows up in "System Tray Settings" as "Bluetooth (Automatic load)" (which I have set to "Show When Relevant", with no keybindings).  I think that's part of Bluedevil; let me know if I misfiled the bug.

I'm sorry I don't have steps-to-reproduce.  I'm hoping the bug will be evident on inspection, but if you need me to experiment, let me know.
Comment 1 Joel Ray Holveck 2021-03-04 00:18:59 UTC
This may be related to 422691 (which was closed in the 5.19 branch).  Adding Nate to the cc list.
Comment 2 Nate Graham 2021-03-04 14:32:23 UTC
I experienced this recently and debugged a bit. It's not the same issue as in Bug 422691, which was happening with the front-end UI. The problem here appears to be in the back-end, in the data model itself. Occasionally, the model tells the UI the wrong device when asked for the list of connected devices.
Comment 3 Nate Graham 2021-04-05 16:19:57 UTC
*** Bug 422691 has been marked as a duplicate of this bug. ***
Comment 4 James John 2021-04-05 19:04:41 UTC
I am new here, I am not sure how the contribution works, but I am ready to help.
I see a bug in the master branch - https://invent.kde.org/plasma/bluedevil/-/blob/master/src/applet/package/contents/ui/logic.js#L41

And it is what I still have in my PC is:

[donjajo@jajo ~]$ plasmashell --version
plasmashell 5.21.3
[donjajo@jajo ~]$ sed -n 41p  /usr/share/plasma/plasmoids/org.kde.plasma.bluetooth/contents/ui/logic.js
        text = i18n("%1 connected", device.name);
[donjajo@jajo ~]$ 

`device.name` should be `connectedDevices[0].name`
Comment 5 Nate Graham 2021-04-05 20:13:33 UTC
Oh jeez. That probably is the bug. Or at least a component of it.
Comment 6 Nate Graham 2021-04-05 20:17:40 UTC
You can submit a merge request at https://invent.kde.org/plasma/plasma-pa/-/merge_requests. Documentation is available at https://community.kde.org/Infrastructure/GitLab.

BTW I tested your proposed change and it does seem to fix the problem. So please do submit it so you can claim the credit! :)

Make sure to put:

BUG: 433932
FIXED-IN: 5.21.4

In the commit message. Thanks!
Comment 7 James John 2021-04-05 20:36:32 UTC
When I reported the bug on Reddit today, I stumbled on this commit you did - https://invent.kde.org/plasma/bluedevil/commit/29a535b1edfbd46b77b04ae43cd279729f0e6b82

Which led to figuring out the root cause, but for some unknown reasons, this commit was reverted or was not pushed?
Comment 8 Nate Graham 2021-04-05 21:25:58 UTC
ohhhhhhhhhh

I guess it never got merged forward! I'll fix it.
Comment 9 Nate Graham 2021-04-05 21:27:40 UTC

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