flottbot
flottbot copied to clipboard
Random response when multiple rules have same trigger
Report
What did you do?
Added multiple rules with different file names, but had the same respond
keyword.
What did you expect to happen?
Warn that you have multiple rules with the same respond
.
What happened instead?
Rules are randomly triggered without notification to the bot.
Extension of this issue: support multiple rules.
Could we just allow multiple rules to match on the same input and both run on the input?
Ideally, we could also support a flag in the .yml config file that allows or disables this feature for a given rule, something like allow_other_rules
or ignore_all_other_rules
or continue_matching_after_execution
.
yea, i think it's that or go the other way.. print a warning that it detected duplicate rule names and execute neither.
How about this?
By default, we don't stop finding matches after one is found. That means, if there are multiple rules matched, they will all execute. (basically what @mackenziegrimes was saying).
In addition, we add something like enforce_unique_trigger: <bool>
(false
by default) at the global level. For community managed bots where multiple people can manage rules, it might help prevent accidental overlap? we'd just run a validator first or something.