此问题仅存在于 Converse API 中,使用 Webchat 时它可以正常工作。
检查数据库时,“createdOn”中的时间戳对于按顺序发送的消息完全相同,这就是顺序混淆的原因,例如:
- 要求用户输入
- 渲染用户输入后应显示的消息
- 并且仅在之后呈现用户输入
奇怪的是,在查看数据库时,列中的createdOn
属性与event
列中的时间戳不同createdOn
,实际上是用于对事件进行排序:
活动专栏
//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 列
//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
有什么办法可以防止这种情况发生吗?