WideChat / Rocket.Chat

Have your own Slack like online chat, built with Meteor.
https://rocket.chat/
Other
3 stars 1 forks source link

[Investigate] whatsApp seeing a lot of out-of-order messages when dialogflow sends back multiple payloads in one request #809

Open chadgoss opened 3 years ago

chadgoss commented 3 years ago

it seems to be random, the twilio logs makes that even more confusing in the first case, the twilio logs seem to show that it send those messages in order but they did not appear on my phone in order in the second case, twilio logs messages 5 before message 4 but they show up on my whatsapp in the correct order

chadgoss commented 3 years ago
Screen Shot 2021-06-30 at 11 16 44 AM
chadgoss commented 3 years ago

the order is correct in rocket.chat omnichannel room view

Screen Shot 2021-06-30 at 11 17 19 AM
chadgoss commented 3 years ago

might be a twilio/whatsapp thing, and maybe we need to add some artificial delay in sending message to twilio

ear-dev commented 3 years ago

@AlexanderKanakis please document your findings and possible solutions here..... tag Steve.

AlexanderKanakis commented 3 years ago

@chadgoss @ear-dev Twillio cannot guarantee correct payload order even if they have been sent to the client in the correct order. We have two possible solutions:

  1. After creating a message we number each payload. Create a queue of payloads for each room and track for successful responses after sending each one to Twilio before sending the next. This will heavily slow down the response speed for the client.
  2. Concatinate DF payloads together as much as possible (when concerned about order)