botkit-cms icon indicating copy to clipboard operation
botkit-cms copied to clipboard

`controller.studio.runTrigger` should resolve promise regardless of whether a trigger was matched

Open jaipandya opened this issue 6 years ago • 1 comments

While working with the cms locally, using useLocalStudio = true, evaluateTrigger doesn't exactly behave the way it should. In the case where no trigger was matched, the promise is rejected (which it should resolve to mimic the functionality of CMS run as remote API service)

https://github.com/howdyai/botkit-cms/blob/a98c9b8b1e033f90d2f2682b4612ec2018b4d8db/src/api.js#L252

When run as an API service, evaluateTrigger always resolves, even when there was no match. This in turn affects the Promise object returned by runTrigger

Also have a look at https://github.com/howdyai/botkit/commit/ef69730558cefdc90156387f685b55467b45c9b0

jaipandya avatar Feb 11 '19 18:02 jaipandya

Interesting point! I'll take a look.

benbrown avatar Feb 12 '19 19:02 benbrown