dbusjs / node-dbus-next

🚌 The next great dbus library for node
https://www.npmjs.com/package/dbus-next
156 stars 52 forks source link

Type 'aay' misses special case of Buffer #57

Closed dlech closed 4 years ago

dlech commented 4 years ago

In this method:

    <method name="ResolveService">
      <arg name="interface" type="i" direction="in"/>
      <arg name="protocol" type="i" direction="in"/>
      <arg name="name" type="s" direction="in"/>
      <arg name="type" type="s" direction="in"/>
      <arg name="domain" type="s" direction="in"/>
      <arg name="aprotocol" type="i" direction="in"/>
      <arg name="flags" type="u" direction="in"/>

      <arg name="interface" type="i" direction="out"/>
      <arg name="protocol" type="i" direction="out"/>
      <arg name="name" type="s" direction="out"/>
      <arg name="type" type="s" direction="out"/>
      <arg name="domain" type="s" direction="out"/>
      <arg name="host" type="s" direction="out"/>
      <arg name="aprotocol" type="i" direction="out"/>
      <arg name="address" type="s" direction="out"/>
      <arg name="port" type="q" direction="out"/>
      <arg name="txt" type="aay" direction="out"/>
      <arg name="flags" type="u" direction="out"/>
    </method>

The txt out parameter has a type of aay, so using a client proxy object I would expect it to be unmarshaled as and Array of Buffer objects since ay is treated as a special type (according to the README). However it seems to be unmarshaled as an Array of Array objects.

acrisci commented 4 years ago

Yeah that would be a bug.

acrisci commented 4 years ago

I'm having problems with the marshaller for ay buffer as well. I'm working on a fix that will put everything in line with the docs.

acrisci commented 4 years ago

Please test your application with this change because it's breaking from previous behavior, but correct according to the docs.

dlech commented 4 years ago

I have tested and it is working. Thanks for the fix.