Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

heard_trigger event throws error when the heard message is sent by another bot #1176

Open
gianniszach opened this issue Dec 10, 2017 · 1 comment
Assignees
Labels
Botkit Studio bug legacy pertaining to version 0.7 or below next_release this issue is accepted for inclusion in the next release of botkit

Comments

@gianniszach
Copy link

Hi all,

You can reproduce this issue with the following scenario:

BotA sends a message to a public channel. A BotB has a hear pattern configured which picks up the BotA's message and if we use the heard_trigger event on this message an error is thrown.

The error is caused by the md5 hash created by the botkit/lib/Studio.js (line 721). The heard_trigger is trying to md5(message.user) but since the message is sent by a bot the message.user property doesn't exist and the heard_trigger throws an error.

@benbrown benbrown added the next_release this issue is accepted for inclusion in the next release of botkit label Oct 19, 2018
@LukeBaulch
Copy link
Contributor

I just came across this same issue where Studio.js is trying to md5(message.user) but in my case message is undefined. I am using a custom connector but when calling the spawn function (see below), CoreBot.js triggers the spawned event via botkit.trigger('spawned', [worker]); which as you can see only supplies the worker argument and no message argument.

controller.spawn({}, function (bot) {
    controller.ingest(bot, req.body, res);
});

A temporary solution for me to is just opt-out of studio stats, but I assume you guys probably don't want people to be opting out just to avoid a code bug.

@benbrown benbrown added the legacy pertaining to version 0.7 or below label May 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Botkit Studio bug legacy pertaining to version 0.7 or below next_release this issue is accepted for inclusion in the next release of botkit
Projects
None yet
Development

No branches or pull requests

4 participants