botpress / v12

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

Messenger channel don't wait for an image to be sent to the recipient #890

Closed titusjaka closed 4 years ago

titusjaka commented 4 years ago

Describe the bug When I send an image through Facebook Messenger, the Botpress doesn't wait till it's sent to the user.

To Reproduce Steps to reproduce the behavior:

  1. Create the simplest bot with image payload: image

  2. Integrate it with FB

  3. Send a message to trigger bot interaction

  4. See messages are sent in the wrong order

Expected behavior I expect messages to be sent in the order I have set in the flow editor. It works as expected in web-channel.

Screenshots I recorded screencasts. One for FB messenger and the one for Web-messenger.

FB:

Screen Recording 2019-12-09 at 18 22 22

Web:

Screen Recording 2019-12-09 at 18 30 52

Environment (please complete the following information):

Additional context See the exported bot in attachments bot_testfbimages_1575905627516.zip

titusjaka commented 4 years ago

I tried to dig this issue but I've found nothing. As I see here https://github.com/botpress/botpress/blob/b31b6a57608ad1a14621afdd7684026789669f87/modules/channel-messenger/src/backend/messenger.ts#L309

and here https://github.com/botpress/botpress/blob/b31b6a57608ad1a14621afdd7684026789669f87/modules/channel-messenger/src/backend/messenger.ts#L338

Botpress must wait for the response from Facebook before returning to the flow. I also checked Facebook API directly and it replies only after the image is sent to the recipient.

aintHuman commented 4 years ago

https://github.com/botpress/v12/issues/879

titusjaka commented 4 years ago

Ok, I should close this issue as a duplicate :)