0
votes

System Information

SDK Language: Node.js
SDK Version: 3.8.3
Development Environment: localhost
Issue Description

Following the blogpost https://blog.botframework.com/2017/06/19/Load-Testing-A-Bot/ to load test the bot Im creating a "sink" service to send messages to the bot. Since it uses it as the serviceUrl in the message, the bot talks to the sink service for other purposes too. I can post to the bot, but at one point when the bot is talking back it sends a message of type 'event' 'Debug' that has no conversation object in the address, resulting in an exception being thrown.

Expected Behavior

The bot sends activities back to the sink service

Actual Results

After activity type 'messge' and 'typing' have been sent, the debug event activity raises an exceptoin:

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)
1
sounds like an issue in your code. can you post what you are doing? it seems that you are not handling that type of activity. - Ezequiel Jadib
answered with the solution - Nicolas

1 Answers

0
votes

Found the issue, when calling the bot endpoint, the activity must provide the conversation id. This was not specified in the blogpost. By adding conversation: { id: <id> } to the activity being posted it works