node-dbus icon indicating copy to clipboard operation
node-dbus copied to clipboard

Incorrect Datatypes

Open hatzel opened this issue 9 years ago • 0 comments

I have no experience with DBus, so please forgive me if I write anything stupid in this issue. The original bug (that I believe can be tracked back to this project) is that when playing music with gpmdp (a music player) the control tool playerctl doesn't work right. The corresponding issue can be found here.

It appears as though the datatypes that are being send don't adhere to the mpris music control protocol. The project implementing the DBus protocol used in gpmdp node-mpris however does specify the datatype correctly. So I tried to reproduce this issue in an isolated script.

This gist shows my code. I tried getting the properties specified in the gist using qdbus: qdbus test.lol /test/lol test.lol.i1.double. Even though each of the properties specifies a double datatype (using 'd') I get different datatypes when observing the communication with dbus-monitor.

method call time=1480864908.327238 sender=:1.4244 -> destination=test.lol serial=7 path=/test/lol; interface=org.freedesktop.DBus.Properties; member=Get
   string "test.lol.i1"
   string "uint32"
method return time=1480864908.327619 sender=:1.4210 -> destination=:1.4244 serial=11 reply_serial=7
   variant       uint32 257

This in seems to be caused by the encoder in this project which just classifies any integer below 255 as a byte.

If I understand the code correctly the datatype that is provided is actually not taken into account meaning many protocols will be impossible to implement correctly. Please consider changing this behavior to actually take the type provided in the interface definition into account.

hatzel avatar Dec 04 '16 15:12 hatzel