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
The client adds a listener to the test D-Bus signal three times => Instead of receiving the signal three times the client receives the signal nine times!
import*asdbusfrom'dbus-next';asyncfunctionmain(){constlog1=(str: string)=>{console.log('1 ',str)};constlog2=(str: string)=>{console.log(' 2 ',str)};constlog3=(str: string)=>{console.log(' 3',str)};constbus=dbus.sessionBus();constobj=awaitbus.getProxyObject('org.test.test','/org/test/test');consttestIface=obj.getInterface('org.test.iface');testIface.on('test',log1);testIface.on('test',log2);testIface.on('test',log3);}main().catch((err)=>{console.log('Error:'+err);});/*$ node dist/dbus_client.js1 Tue, 16 Feb 2021 00:17:52 GMT 2 Tue, 16 Feb 2021 00:17:52 GMT 3 Tue, 16 Feb 2021 00:17:52 GMT1 Tue, 16 Feb 2021 00:17:52 GMT 2 Tue, 16 Feb 2021 00:17:52 GMT 3 Tue, 16 Feb 2021 00:17:52 GMT1 Tue, 16 Feb 2021 00:17:52 GMT 2 Tue, 16 Feb 2021 00:17:52 GMT 3 Tue, 16 Feb 2021 00:17:52 GMT1 Tue, 16 Feb 2021 00:18:02 GMT 2 Tue, 16 Feb 2021 00:18:02 GMT 3 Tue, 16 Feb 2021 00:18:02 GMT1 Tue, 16 Feb 2021 00:18:02 GMT 2 Tue, 16 Feb 2021 00:18:02 GMT 3 Tue, 16 Feb 2021 00:18:02 GMT1 Tue, 16 Feb 2021 00:18:02 GMT 2 Tue, 16 Feb 2021 00:18:02 GMT 3 Tue, 16 Feb 2021 00:18:02 GMT1 Tue, 16 Feb 2021 00:18:12 GMT 2 Tue, 16 Feb 2021 00:18:12 GMT 3 Tue, 16 Feb 2021 00:18:12 GMT1 Tue, 16 Feb 2021 00:18:12 GMT 2 Tue, 16 Feb 2021 00:18:12 GMT 3 Tue, 16 Feb 2021 00:18:12 GMT1 Tue, 16 Feb 2021 00:18:12 GMT 2 Tue, 16 Feb 2021 00:18:12 GMT 3 Tue, 16 Feb 2021 00:18:12 GMT*/
I found a fix for this issue but maybe not the best: Simply check the amount of listeners
I have a simple D-Bus service. The service has only one signal called
test
and the service emits every ten seconds the current date.The client adds a listener to the
test
D-Bus signal three times => Instead of receiving the signal three times the client receives the signal nine times!I found a fix for this issue but maybe not the best: Simply check the amount of listeners
lib/client/proxy-interface.js
The text was updated successfully, but these errors were encountered: