roslibjs
roslibjs copied to clipboard
Duplicate messages when subscribing to a topic multiple times
Hi all,
if a website subscribes to a topic multiple times which is latched, each subscriber gets all latched messages. That might be a problem because a subscriber to a topic can not know whether the received messages are new and relevant.
Steps to reproduce the problem
- Run a roscore with a latched topic. Let's call it '/example_topic/'
- Publish some messages on the topic.
- In your website subscribe to the topic. The subscriber will get all latched messages of the topic.
- Add another subscriber to the topic with the same instance of roslibjs. The second subscriber gets all latched messages of the topic, but so does the first subscriber although there were no new messages.
I got the same!