Closed imobachgs closed 2 years ago
I have reproduced the problem using d-installer, will make a reproducer/test-case here.
The problem is that all the current calls of PropertiesChanged
treat it as just another method: they use a plain Ruby value of the changed property and the formal parameter of the method is of the variant type. So, the marshalling code ends up having to guess the type.
We need to special-case PropertiesChanged
to refer to the specific type of the property, similar to what the client code does in #113.
Also we need to adapt the documentation for DBus::Object to mention the correct usage (and add a helper for it?)
To reproduce here:
$ SVC="org.ruby.service"; dbus-monitor --session "sender='$SVC'" "destination='$SVC'" &
$ bundle exec spec/service_newapi &
$ busctl --user set-property \
org.ruby.service /org/ruby/MyInstance org.ruby.SampleInterface MyStruct '(sss)' aa bb cc
method call time=1655217312.613765 sender=:1.1473 -> destination=org.ruby.service serial=2 path=/org/ruby/MyInstance; interface=org.freedesktop.DBus.Properties; member=Set
string "org.ruby.SampleInterface"
string "MyStruct"
variant struct {
string "aa"
string "bb"
string "cc"
}
signal time=1655217312.616923 sender=:1.1467 -> destination=(null destination) serial=44 path=/org/ruby/MyInstance; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
string "org.ruby.SampleInterface"
array [
dict entry(
string "MyStruct"
variant array [
variant string "aa"
variant string "bb"
variant string "cc"
]
)
]
array [
]
The four lines after string "MyStruct"
should be the same in the signal and the method call, but the signal got it wrong.
This issue basically blocks https://github.com/yast/d-installer/pull/192 as it does not properly redraw storage proposal after change of product.
In D-Installer we have an object with the following properties:
However, when we launch a
PropertiesChanged
signal to change theFirstUser
property, the list of changes looks like this:We expected a struct, but that's not the case. The problem can be reproduced by using the D-Installer CLI:
Could you have a look, please? Thanks!