This issue only exists with the Converse API, when using the Webchat it works fine.
When checking the database the timestamp in ‘createdOn’ is the exact same for messages that are sent sequentially, which is the reason why the order is mixed up, e.g.:
- The user is asked for an input
- The Message that should be display after User Input is render
- And only afterwards the user input is rendered
The strange thing is, when looking at the database, the createdOn
property in the event
column has a different timestamp than in the createdOn
column, which is actually used to sort the events :
Event Column
//Dropdown Component that asks user for input
{""type"":""custom"",""channel"":""api"",""direction"":""outgoing"",""createdOn"":""2021-04-13T12:45:54.924Z""}
//Answer that is supposed to be displayed after user input
{""type"":""text"",""channel"":""api"",""direction"":""outgoing"",""createdOn"":""2021-04-13T12:46:02.645Z““}
//User Input
{""type"":""text"",""channel"":""api"",""direction"":""incoming"",""createdOn"":""2021-04-13T12:46:02.420Z""}
CreatedOn Column
//Dropdown Component
2021-04-13 12:45:55.243118+00
//Message that should be displayed after User Input
2021-04-13 12:46:03.253342+00
//User Input
2021-04-13 12:46:03.253342+00
Is there any way to prevent this?