系统信息
SDK Language: Node.js
SDK Version: 3.8.3
Development Environment: localhost
Issue Description
在blogpost https://blog.botframework.com/2017/06/19/Load-Testing-A-Bot/之后加载测试机器人Im创建一个" sink"服务将消息发送到机器人。由于它将它用作消息中的serviceUrl,因此机器人也会与接收服务进行通信以达到其他目的。 我可以发布到机器人,但是当机器人正在回话时,它会发送一个类型为“事件”的消息。 '调试'在地址中没有会话对象,导致抛出异常。
预期行为
机器人将活动发送回接收服务
实际结果
活动类型'消息'并且打字'已经发送,调试事件活动提出了一个例外:
TypeError: Cannot read property 'id' of undefined
at ChatConnector.postMessage (/Users/nico/workspace/ambitai/codereview/server/node_modules/botbuilder/lib/bots/ChatConnector.js:459:82)
at /Users/nico/workspace/ambitai/codereview/server/node_modules/botbuilder/lib/bots/ChatConnector.js:165:27
at iterate (/Users/nico/workspace/ambitai/codereview/server/node_modules/async/lib/async.js:262:13)
at Object.async.forEachOfSeries.async.eachOfSeries (/Users/nico/workspace/ambitai/codereview/server/node_modules/async/lib/async.js:281:9)
at ChatConnector.send (/Users/nico/workspace/ambitai/codereview/server/node_modules/botbuilder/lib/bots/ChatConnector.js:159:15)
at RemoteSessionLogger.flush (/Users/nico/workspace/ambitai/codereview/server/node_modules/botbuilder/lib/RemoteSessionLogger.js:74:24)
at /Users/nico/workspace/ambitai/codereview/server/node_modules/botbuilder/lib/Session.js:638:26
at /Users/nico/workspace/ambitai/codereview/server/node_modules/async/lib/async.js:52:16
at Object.async.forEachOf.async.eachOf (/Users/nico/workspace/ambitai/codereview/server/node_modules/async/lib/async.js:236:30)
at Object.async.forEach.async.each (/Users/nico/workspace/ambitai/codereview/server/node_modules/async/lib/async.js:209:22)
at Session.onFinishBatch (/Users/nico/workspace/ambitai/codereview/server/node_modules/botbuilder/lib/Session.js:616:15)
at /Users/nico/workspace/ambitai/codereview/server/node_modules/botbuilder/lib/Session.js:430:27
at /Users/nico/workspace/ambitai/codereview/server/node_modules/botbuilder/lib/Session.js:606:17
at /Users/nico/workspace/ambitai/codereview/server/node_modules/botbuilder/lib/bots/UniversalBot.js:523:17
at /Users/nico/workspace/ambitai/codereview/server/node_modules/botbuilder/lib/bots/ChatConnector.js:178:36
at /Users/nico/workspace/ambitai/codereview/server/node_modules/async/lib/async.js:52:16
at /Users/nico/workspace/ambitai/codereview/server/node_modules/async/lib/async.js:269:32
at /Users/nico/workspace/ambitai/codereview/server/node_modules/async/lib/async.js:44:16
at /Users/nico/workspace/ambitai/codereview/server/node_modules/botbuilder/lib/bots/ChatConnector.js:167:25
at /Users/nico/workspace/ambitai/codereview/server/node_modules/botbuilder/lib/bots/ChatConnector.js:474:21
at Request._callback (/Users/nico/workspace/ambitai/codereview/server/node_modules/botbuilder/lib/bots/ChatConnector.js:508:37)
at Request.self.callback (/Users/nico/workspace/ambitai/codereview/server/node_modules/request/request.js:188:22)
答案 0 :(得分:0)
发现问题,在调用bot端点时,活动必须提供会话ID。博客帖子中没有指明这一点。通过向正在发布的活动添加F
,可以使用