eclipse-cyclonedds / cyclonedds-cxx

Other
93 stars 74 forks source link

Subscribe for inherited topic with @key attribute #463

Closed tonichedgehog closed 10 months ago

tonichedgehog commented 10 months ago

Hi, I'm have a question on subscribing on the following topic:

@nested
struct Foo {
    @key long number_1;
};

@topic
struct Bar : Foo {
    long number_2;
};

Removing the @key attribute from Foo::number_1 produces the expected result, my subscriber receives updates on the (now unkeyed) sample. With the @key attribute, my subscriber won't receive any updates. I suspect I'm missing something, essential here, and would appreciate some help pointing me in the right direction.

I'm using CycloneDDS 0.10.4, with gcc13 under MSYS2.

mini-example.zip

Thanks in advance, /T

tonichedgehog commented 10 months ago

Ok, found that this issue is already fixed on master with 7c299e45. Putting that on top of 0.10.4 solves the problem.

eboasson commented 10 months ago

It was on my to-do list to look at your issue, but this is even better! Thanks for letting us know ☺️