Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't loose signals when no previous method calls have been made. #87

Merged
merged 2 commits into from
Sep 18, 2021

Conversation

sdrik
Copy link
Contributor

@sdrik sdrik commented Sep 18, 2021

ProxyInterface's listener is dropping signals if the sender does not match an already known name owner for the proxied object.

This can occur when no previous method call have been sent to this object, which is always the case for a newly XML-constructed proxy object. Moreover, if the object doesn't expose any method, it is simply impossible to get any signal from it !

In the introspection case, the initial org.freedesktop.Introspectable.Introspect call will always make the name owner initially known to the bus connection.

To prevent this, we're getting the name owner during the XML based proxy construction by querying the org.freedesktop.DBus.GetNameOwner method.

Fixes #86

ProxyInterface's listener is dropping signals if the sender does not
match an already known name owner for the proxied object.

This can occur when no previous method call have been sent to this
object, which is always the case for a newly XML-constructed proxy
object. Moreover, if the object doesn't expose any method, it is simply
impossible to get any signal from it !

In the introspection case, the initial
org.freedesktop.Introspectable.Introspect call will always make the name
owner initially known to the bus connection.

To prevent this, we're getting the name owner during the XML based
proxy construction by querying the org.freedesktop.DBus.GetNameOwner
method.

Fixes dbusjs#86
@sdrik sdrik changed the title Don't loose signals when no previous method calls have been made. (Fixes #86) Don't loose signals when no previous method calls have been made. Sep 18, 2021
@acrisci
Copy link
Member

acrisci commented Sep 18, 2021

👍

@acrisci acrisci merged commit ac7b17a into dbusjs:master Sep 18, 2021
@sdrik sdrik deleted the fix-initial-signals-lost branch September 19, 2021 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Initial signals lost when no previous method call have been made
2 participants