Closed 78454674 closed 2 years ago
I have found the issue myself. IntelliJ creates preview files wit the created JavaScript from the coffee script. The coffeescript and JavaScript files where both loaded. https://www.jetbrains.com/help/idea/coffeescript.html#ws_coffee_before_you_start
Removing the JavaScript files solved the issue.
Description
When sending a message to hugo with a custom script that has a
robot.respond
function, hubot seems to receive the message twice and as a result executes the listener callback twice as well.This only happens with one script that has an external dependency. With other scripts hugo does not exhibit this behavior.
In the script with the faulty behavior, I send a POST message using the library needle. I'm using this script with Rocket.Chat.
Everything below
robot.respond create_regex, (msg) ->
is executed twice.But the same issue happens, when I comment out the
needle.request
portion of the code.The message is the following.
The regex is:
The following are the log messages I see with Debug enabled.
The following screenshot also shows the behavior. The first message get's the response from the
needle.request
. In the second message, theneedle.request
is commented out.The third request is another script where a cat pic is returned. The cat pic is returned only once by the bot.
Expected behavior
The bot only executed the listener callback once.