https://bugs.kde.org/show_bug.cgi?id=507653

            Bug ID: 507653
           Summary: kactivitymanagerd Activities DBus introspection
                    metadata lists incorrect result types for some methods
    Classification: Plasma
           Product: plasmashell
      Version First 6.4.3
       Reported In:
          Platform: Fedora RPMs
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Activities in general
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: 1.0

SUMMARY
The DBus interface for ActivityInformation and ListActivitiesWithInformation
(and possibly others) advertises results consisting of 3 strings and a double:

https://invent.kde.org/plasma/kactivitymanagerd/-/blob/master/src/common/dbus/org.kde.ActivityManager.Activities.xml?ref_type=heads#L51

The actual C++ structure consists of 4 strings and an integer:

https://invent.kde.org/plasma/kactivitymanagerd/-/blob/master/src/common/dbus/org.kde.ActivityManager.Activities.h?ref_type=heads#L13

This causes DBus bindings that depend on introspection (e.g. pydbus) to fail to
decode method call results.

STEPS TO REPRODUCE
The following python script demonstrates the problem:

#!/usr/bin/env python3
import pydbus
bus = pydbus.SessionBus()
activities = bus.get("org.kde.ActivityManager", "/ActivityManager/Activities")
print(activities.ListActivitiesWithInformation())

1. 
2. 
3. 

OBSERVED RESULT
Traceback (most recent call last):
  File "/var/home/bkoropoff/tablet-activity-switcher", line 5, in <module>
    print(activities.ListActivitiesWithInformation())
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/site-packages/pydbus/proxy_method.py", line 102, in
__call__
    raise error
  File "/usr/lib/python3.13/site-packages/pydbus/proxy_method.py", line 97, in
__call__
    result = instance._bus.con.call_sync(*call_args)
gi.repository.GLib.GError: g-io-error-quark: Method
“ListActivitiesWithInformation” returned type “(a(ssssi))”, but expected
“(a(sssd))” (13)

EXPECTED RESULT

It works.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora Kinoite 42
KDE Plasma Version: 6.4.3
KDE Frameworks Version: 6.16.0
Qt Version: 6.9.1

ADDITIONAL INFORMATION

These methods appear to have had incorrect introspection information since they
were introduced (d was used instead of i in the signature):

https://invent.kde.org/plasma/kactivitymanagerd/-/commit/4c6e1d3936e528a715df19d63b1e3a6fa1f2b808

An additional field was added later without updating the XML:

https://invent.kde.org/plasma/kactivitymanagerd/-/commit/901638dbf870cb6e7eeac529c1d30c724c2faf39

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to