roscpp_core icon indicating copy to clipboard operation
roscpp_core copied to clipboard

MessageEvent constructors without connection information

Open dirk-thomas opened this issue 11 years ago • 5 comments

The MessageEvent constructors not receiving connections header are "evil". I tried to remove them in #21 before but could not get rid of all code which uses it (therefore they have been reintroduced).

But in two cases that already backfired. Two code parts which worked before behaved wrong (silently having empty connection header) which was difficult to spot:

  • https://github.com/ros/ros_comm/commit/9b0600e52530761bf389828afe78e1d98c6a46c0#diff-6647d572e622dca2a759e1c20a83eb4eL210
  • https://github.com/ros/actionlib/commit/856fe223a5dda2cdbb4d970442794a9767bb535d

In both cases with the "evil" MessageEvent constructors present the code compiles but does not work correctly due to the missing connection info. When the two constructors are commented out the code fails to build. I worked around that with the two commits referenced above.

But this should not be necessary. I think the templated functions for subscribing to topics should deal with this problem and avoid the usage of the "evil" constructors without requiring the commited hacks.

dirk-thomas avatar Feb 14 '14 00:02 dirk-thomas

@esteve @tfoote @wjwwood Any support is highly appreciated. We should be able to remove these "evil" constructors and also not require the above referenced commits (aka. hacks).

dirk-thomas avatar Feb 14 '14 00:02 dirk-thomas

Is anybody still working on this?

kalectro avatar Jun 16 '16 06:06 kalectro

The milestone descriptions says:

It is unlikely that the maintainers will have time to address these issues. Please provide pull requests if you want these issues to be addressed.

dirk-thomas avatar Jun 16 '16 15:06 dirk-thomas

What about deprecating these constructors? This would make it easier to spot the places, where they are used without breaking any code all of a sudden.

cwecht avatar Feb 28 '19 09:02 cwecht

What about deprecating these constructors?

I don't think that's possible in an already released distro. Some packages take warnings as build errors, so we can't add any.

peci1 avatar Jun 06 '23 17:06 peci1