howdyai / botkit-cms

An open tool for designing, building and managing interactive dialog systems
https://botkit.ai
MIT License
265 stars 92 forks source link

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

Open jaipandya opened 5 years ago

jaipandya commented 5 years ago

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

benbrown commented 5 years ago

Interesting point! I'll take a look.