flottbot icon indicating copy to clipboard operation
flottbot copied to clipboard

Random response when multiple rules have same trigger

Open JordanSussman opened this issue 6 years ago • 3 comments

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.

JordanSussman avatar Oct 08 '18 18:10 JordanSussman

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.

mackenziegrimes avatar Sep 23 '19 17:09 mackenziegrimes

yea, i think it's that or go the other way.. print a warning that it detected duplicate rule names and execute neither.

wass3r avatar Jul 03 '20 03:07 wass3r

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.

wass3r avatar Jul 22 '21 17:07 wass3r