botpress / v12

Botpress OSS – v12
https://v12.botpress.com
GNU Affero General Public License v3.0
69 stars 83 forks source link

Broadcast module - Filters not working #1739

Open Naroh091 opened 1 year ago

Naroh091 commented 1 year ago

Describe the bug Messages are never sent to users matching the filters.

To Reproduce Steps to reproduce the behavior:

  1. Enable the broadcast module.
  2. Open a conversation using the emulator.
  3. Go to the broadcast module, create a new one, and add channel == 'web' as a filter. Remember to click the 'Add' button to actually add the filter.

image

Expected behavior The message is sent to the matching users, which are those with channel == web, so at least the emulator conversation should receive it.

Instead, no message is sent.

Environment (please complete the following information):

Additional context The main problem is that in daemon.ts, line 38, Botpress returns this typeof v !== 'undefined' && v !== null instead of the value of v, the variable in which the result of the matching is stored. If everything works fine v won't be undefined nor null, thus returning "true", which is the final value of drop of the dropPromise, dropping that message.

From what I've read I know that the Broadcast module was never ready, but I think it would be nice to have at least this fixed - I'll send a pull request in a couple of minutes.