Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Many property changed signals received by BlueZAgent #1959

Open
infirit opened this issue Dec 3, 2022 · 0 comments
Open

Many property changed signals received by BlueZAgent #1959

infirit opened this issue Dec 3, 2022 · 0 comments
Assignees
Labels

Comments

@infirit
Copy link
Contributor

infirit commented Dec 3, 2022

I'll have to investigate further but this causes issues when we try to pop the signalhandler (see patch below where exactly). marking as bug for now.

diff --git a/blueman/main/applet/BluezAgent.py b/blueman/main/applet/BluezAgent.py
index f59bd3ac7..3954325de 100644
--- a/blueman/main/applet/BluezAgent.py
+++ b/blueman/main/applet/BluezAgent.py
@@ -140,8 +140,11 @@ class BluezAgent(DbusService):
 
     # Workaround BlueZ not calling the Cancel method, see #164
     def _on_device_property_changed(self, device: Device, key: str, value: Any, path: str) -> None:
+        logging.debug(f"{device['Alias']} {key} {value} {path}")
         if (key == "Paired" and value) or (key == "Connected" and not value):
-            handlerid = self._devhandlerids.pop(path)
+            handlerid = self._devhandlerids.pop(path, None)
+            if handlerid is None:
+                return None
             device.disconnect_signal(handlerid)
             self._on_cancel()

appletlog

blueman-applet 14.14.35 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 ServicesResolved True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.35 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 ServicesResolved True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.35 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 ServicesResolved True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.35 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 ServicesResolved True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.35 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 ServicesResolved True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.35 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 ServicesResolved True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.35 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 ServicesResolved True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.35 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Paired True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.35 INFO     BluezAgent:157 _on_cancel: Agent.Cancel
blueman-applet 14.14.35 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Paired True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.35 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Paired True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.35 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Paired True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.35 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Paired True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.35 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Paired True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.35 DEBUG    Base:60 do_g_properties_changed: /org/bluez/hci0/dev_F4_73_35_0C_D6_01 {'WakeAllowed': True}
blueman-applet 14.14.35 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 WakeAllowed True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.35 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 WakeAllowed True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.35 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 WakeAllowed True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.35 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 WakeAllowed True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.35 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 WakeAllowed True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.35 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 WakeAllowed True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.40 DEBUG    Base:60 do_g_properties_changed: /org/bluez/hci0/dev_F4_73_35_0C_D6_01 {'ServicesResolved': False, 'Connected': False}
blueman-applet 14.14.40 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 ServicesResolved False /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.40 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 ServicesResolved False /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.40 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 ServicesResolved False /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.40 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 ServicesResolved False /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.40 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 ServicesResolved False /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.40 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 ServicesResolved False /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.40 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Connected False /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.40 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Connected False /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.40 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Connected False /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.40 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Connected False /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.40 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Connected False /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.40 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Connected False /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.14.49 DEBUG    Manager:73 _on_object_removed: /org/bluez/hci0/dev_B6_B6_86_18_D6_E9
blueman-applet 14.14.49 INFO     Applet:112 on_device_removed: Device removed /org/bluez/hci0/dev_B6_B6_86_18_D6_E9
blueman-applet 14.15.31 INFO     RecentConns:112 notify    : <Device.Device object at 0x7f2cfc26dec0 (blueman+bluez+Device+Device at 0x561d1e60b470)> 00000000-0000-0000-0000-000000000000
blueman-applet 14.15.32 DEBUG    Base:60 do_g_properties_changed: /org/bluez/hci0/dev_F4_73_35_0C_D6_01 {'Connected': True}
blueman-applet 14.15.32 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Connected True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.15.32 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Connected True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.15.32 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Connected True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.15.32 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Connected True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.15.32 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Connected True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.15.32 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Connected True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.15.34 INFO     Notification:242 do_g_signal: 1
blueman-applet 14.15.34 DEBUG    Notification:246 do_g_signal: The notification expired.
blueman-applet 14.15.34 DEBUG    Base:60 do_g_properties_changed: /org/bluez/hci0/dev_F4_73_35_0C_D6_01 {'ServicesResolved': True}
blueman-applet 14.15.34 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 ServicesResolved True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.15.34 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 ServicesResolved True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.15.34 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 ServicesResolved True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.15.34 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 ServicesResolved True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.15.34 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 ServicesResolved True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.15.34 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 ServicesResolved True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.15.41 DEBUG    Base:60 do_g_properties_changed: /org/bluez/hci0/dev_F4_73_35_0C_D6_01 {'Trusted': True}
blueman-applet 14.15.41 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Trusted True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.15.41 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Trusted True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.15.41 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Trusted True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.15.41 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Trusted True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.15.41 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Trusted True /org/bluez/hci0/dev_F4_73_35_0C_D6_01
blueman-applet 14.15.41 DEBUG    BluezAgent:143 _on_device_property_changed: Keyboard K480 Trusted True /org/bluez/hci0/dev_F4_73_35_0C_D6_01```
@infirit infirit added the bug label Dec 3, 2022
@infirit infirit self-assigned this Dec 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant