Regression with DBus proxies
Sample code:
const {Gio} = imports.gi;
const ByteArray = imports.byteArray;
const PizzaIface = `
<node>
<interface name='pizza.yeah.Whatever'>
<method name="Order">
<arg type='ay' name='topping' direction='in'/>
</method>
</interface>
</node>
`;
const PizzaPortal = Gio.DBusProxy.makeProxyWrapper(PizzaIface);
const portal = new PizzaPortal(Gio.DBus.session,
'pizza.yeah.Whatever', '/pizza/yeah/Whatever');
const hawaiian = ByteArray.fromString('Pineapple');
portal.OrderSync(hawaiian);
Output:
(gjs:60): Gjs-WARNING **: 15:16:08.614: JS ERROR: TypeError: byteArray.toGBytes is not a function
_makeBytes@resource:///org/gnome/gjs/modules/overrides/GLib.js:71:16
_pack_variant@resource:///org/gnome/gjs/modules/overrides/GLib.js:124:48
_pack_variant@resource:///org/gnome/gjs/modules/overrides/GLib.js:150:20
_init/this.Variant._new_internal@resource:///org/gnome/gjs/modules/overrides/GLib.js:260:16
_proxyInvoker@resource:///org/gnome/gjs/modules/overrides/Gio.js:66:21
_makeProxyMethod/<@resource:///org/gnome/gjs/modules/overrides/Gio.js:112:16
@moreFundamentalBug.js:21:1
This should not only be fixed, but test coverage must be added, since the tests didn't catch it during the ByteArray refactor.