framely / community

MIT License
0 stars 2 forks source link

[Bug]: Duplicate confirmation in Messenger channel #810

Closed hisunnymay closed 1 year ago

hisunnymay commented 1 year ago

Is there an existing issue for this?

Make sure you are using OpenCUI on Google Chrome!

Current Behavior

当 Chatbot tableReservationApp 用 debug 测试成功之后,将该 chatbot 部署到 Messenger channel 后, 每次当 user 要取消预定时,bot 都输出了3次 confirmation: "Are you sure to cancel it?",对话如下图所示

image

Log: cancelReservation-messenger_0209.txt

  1. user 只发送了一次 "I want to cancel my reservation",但 log 中有三个 "Getting I want to cancel my reservation"
  2. user 发送取消预定的请求的时间和 bot 第一次回复该请求的时间间隔了 40s

Expected Behavior

当 user 只发送一次 "I want to cancel my reservation" 时,bot 不应该输出重复的 "Are you sure to cancel it?"

Use Case

/

Steps To Reproduce

详见 Messenger Test 中的测试步骤

Label of org.project

/

OpenCUI Link

https://build.opencui.io/org/63e32e697ad4281fd8e100ad/agent/63e3528118ead42aac3be2f2/version

Test Case

No response

Additional information

No response

hisunnymay commented 1 year ago

Checked, it's fixed by pr #59

hisunnymay commented 1 year ago

Reopened, due the difference of test case, this is issue is not fixed yet

hisunnymay commented 1 year ago

We assume the duplicate confirmation is caused by the response time of the chatbot.

According to Messenger-webhooks, there might be a chance that when the Messenger platform doesn't get 200 OK within 5 seconds, Messenger will resent the event. Therefore, there were 3 "Getting I want to cancel my reservation" in the log.

In order to fix this issue, we may need to reduce the response time.

hisunnymay commented 1 year ago

在 debug 中调用 CancelReservation, 从下面的 log 中可以推断出 listReservation() 被调用了 62 次,chatbot 响应时间较长可能和这个有关。

log:cancelReservation.txt

image

参考 countTimesFunctionCalled 中的 Test - 0209,vr 的 source 和 confirmation 的 condition 均会被多次调用

hisunnymay commented 1 year ago

Checked, it's fixed.

GC3nhPXTch