When the DDP connection to the BOT gets lost, the BOT will try to reopen the connection. When the connection is back, it will try to re-subscribe to the topics without unsubscribing the old ones. That can cause duplication of the message in the method bot.respondToMessages()
Step to reproduce
Run a bot which replies the incoming messages with respondToMessages() method
Disconnect the connection between the bot and the RocketChat server (turn off the server/turn off Nginx/etc)
Wait for the bot to start to reopen connection interval
Reconnect the connection between the bot and the RocketChat server
Expected behavior
Bot calls the callback in responseToMessages()once per message
Actual behavior
Bot calls the callback in responseToMessages()multiple times per message
Description
When the DDP connection to the BOT gets lost, the BOT will try to reopen the connection. When the connection is back, it will try to re-subscribe to the topics without unsubscribing the old ones. That can cause duplication of the message in the method
bot.respondToMessages()
Step to reproduce
respondToMessages()
methodExpected behavior
Bot calls the callback in
responseToMessages()
once per messageActual behavior
Bot calls the callback in
responseToMessages()
multiple times per message