You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the error is ignored anyways and it works just fine, a solution might be just to return true in that case. However I don't know the impact on other code.
So maybe just do the check before even calling Encoder::EncodeObject in ObjectHandler::_SendMessageReply.
Let me know what to do and I can submit an PR.
Example that causes this output:
constDBusService=DBus.registerService('system',null);constDBusObject=DBusService.createObject("/org/node/bluez");constDBusInterface=DbusObject.createInterface('org.bluez.Profile1');DBusInterface.addMethod('NewConnection',{in: [{type: 'o',name: 'device'},{type: 'h',name: 'fd'},{type: 'a{sv}',name: 'fd_properties'}]},(device,fd,options,callback)=>{console.log("New Connection for "+device);callback();// will print "Failed to encode reply value"});
The text was updated successfully, but these errors were encountered:
Hey, is this going to be looked at? I'd rather not have modules pollute my stdout, and create useless log entries. I understand that not being able to encode a response is an issue and should be reported, but empty replies are features, features which some daemons expect, like bluetoothd. I'd rather not train myself to ignore messages like these in case I actually am making a mistake.
Niels-Be
added a commit
to Niels-Be/node-dbus
that referenced
this issue
Aug 31, 2020
If a service method has no return value an message is printed on stdout.
node-dbus/src/object_handler.cc
Lines 88 to 90 in 7c87b54
This is because
reply_value
isundefined
andEncodeObject
returns false in that case.node-dbus/src/encoder.cc
Lines 163 to 164 in 7c87b54
Since the error is ignored anyways and it works just fine, a solution might be just to return true in that case. However I don't know the impact on other code.
So maybe just do the check before even calling
Encoder::EncodeObject
inObjectHandler::_SendMessageReply
.Let me know what to do and I can submit an PR.
Example that causes this output:
The text was updated successfully, but these errors were encountered: