Is related to botkit but not sure it is of Botkit core because I can not find this error in code
Find how to fix the error. Idk how to reproduce
I am getting this error and idk from where.
Error: missing activity.conversation
Find the error
I also have this issue. In my particular example, I am trying to post a message to a Slack channel on a cron. I spawn a Slack Worker and as per the docs, I call startConversationInThread and I pass it the Slack channel I want to send a message to - this results in the following error:
Cannot read property 'conversation' of undefined
I'm guessing this is because of the way the config is generated when using spawn(). It would be really good to get an answer on this as the docs are not clear at all.
Ok so after a bit more digging - turns out this is related to an issue I spoke to @benbrown about a while ago https://github.com/howdyai/botkit/issues/1754
When spawning a Slack bot using spawn(), you need to provide it with your Slack Team ID. In the Slack Bot Worker constructor it checks specifically for a string type and only sets up the config correctly if you provide a string.
https://github.com/howdyai/botkit/blob/2fc7205c211058e08b20fe780729874189d73962/packages/botbuilder-adapter-slack/src/botworker.ts#L33
This will be less confusing when the docs are updated.
wamphlett, that might be the solution to your problem, but I think it's unrelated to the original problem.
I'm getting "Error: missing activity.conversation" in the web channel, so it's nothing to do with Slack. Here's the trace:
Webhook endpoint online: http://localhost:3000/api/messages
Chat with me: http://localhost:3000
Loading sample web features...
Experienced an error inside the turn handler Error: missing activity.conversation
at BotkitConversationState.getStorageKey (\dev\temp\botkitweb\node_modules\botkit\lib\conversationState.js:23:19)
at BotkitConversationState.storageKey (\dev\temp\botkitweb\node_modules\botbuilder-core\lib\conversationState.js:28:30)
at BotkitConversationState.load (\dev\temp\botkitweb\node_modules\botbuilder-core\lib\botState.js:62:41)
at BotStatePropertyAccessor.<anonymous> (\dev\temp\botkitweb\node_modules\botbuilder-core\lib\botStatePropertyAccessor.js:44:42)
at Generator.next (<anonymous>)
at \dev\temp\botkitweb\node_modules\botbuilder-core\lib\botStatePropertyAccessor.js:8:71
at new Promise (<anonymous>)
at __awaiter (\dev\temp\botkitweb\node_modules\botbuilder-core\lib\botStatePropertyAccessor.js:4:12)
at BotStatePropertyAccessor.get (\dev\temp\botkitweb\node_modules\botbuilder-core\lib\botStatePropertyAccessor.js:43:16)
at DialogSet.<anonymous> (\dev\temp\botkitweb\node_modules\botbuilder-dialogs\lib\dialogSet.js:112:50)
(node:16748) UnhandledPromiseRejectionWarning: Error: missing activity.conversation
at BotkitConversationState.getStorageKey (\dev\temp\botkitweb\node_modules\botkit\lib\conversationState.js:23:19)
at BotkitConversationState.storageKey (\dev\temp\botkitweb\node_modules\botbuilder-core\lib\conversationState.js:28:30)
at BotkitConversationState.load (\dev\temp\botkitweb\node_modules\botbuilder-core\lib\botState.js:62:41)
at BotStatePropertyAccessor.<anonymous> (\dev\temp\botkitweb\node_modules\botbuilder-core\lib\botStatePropertyAccessor.js:44:42)
at Generator.next (<anonymous>)
at \dev\temp\botkitweb\node_modules\botbuilder-core\lib\botStatePropertyAccessor.js:8:71
at new Promise (<anonymous>)
at __awaiter (\dev\temp\botkitweb\node_modules\botbuilder-core\lib\botStatePropertyAccessor.js:4:12)
at BotStatePropertyAccessor.get (\dev\temp\botkitweb\node_modules\botbuilder-core\lib\botStatePropertyAccessor.js:43:16)
at DialogSet.<anonymous> (\dev\temp\botkitweb\node_modules\botbuilder-dialogs\lib\dialogSet.js:112:50)
(node:16748) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:16748) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Same for Twilio. To replicate just do a fresh install of botkit
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I have the same issue with a webhook :
Experienced an error inside the turn handler Error: missing activity.conversation
at BotkitConversationState.getStorageKey (C:\dev\project\starter-botkit-wa-middleware\node_modules\botkit\lib\conversationState.js:23:19)
at BotkitConversationState.storageKey (C:\dev\project\starter-botkit-wa-middleware\node_modules\botbuilder-core\lib\conversationState.js:28:30)
at BotkitConversationState.load (C:\dev\project\starter-botkit-wa-middleware\node_modules\botbuilder-core\lib\botState.js:62:41)
at BotStatePropertyAccessor.<anonymous> (C:\dev\project\starter-botkit-wa-middleware\node_modules\botbuilder-core\lib\botStatePropertyAccessor.js:43:42)
at Generator.next (<anonymous>)
at C:\dev\project\starter-botkit-wa-middleware\node_modules\botbuilder-core\lib\botStatePropertyAccessor.js:7:71
at new Promise (<anonymous>)
at __awaiter (C:\dev\project\starter-botkit-wa-middleware\node_modules\botbuilder-core\lib\botStatePropertyAccessor.js:3:12)
at BotStatePropertyAccessor.get (C:\dev\project\starter-botkit-wa-middleware\node_modules\botbuilder-core\lib\botStatePropertyAccessor.js:42:16)
at DialogSet.<anonymous> (C:\dev\project\starter-botkit-wa-middleware\node_modules\botbuilder-dialogs\lib\dialogSet.js:124:50)
(node:35088) UnhandledPromiseRejectionWarning: Error: missing activity.conversation
at BotkitConversationState.getStorageKey (C:\dev\project\starter-botkit-wa-middleware\node_modules\botkit\lib\conversationState.js:23:19)
at BotkitConversationState.storageKey (C:\dev\project\starter-botkit-wa-middleware\node_modules\botbuilder-core\lib\conversationState.js:28:30)
at BotkitConversationState.load (C:\dev\project\starter-botkit-wa-middleware\node_modules\botbuilder-core\lib\botState.js:62:41)
at BotStatePropertyAccessor.<anonymous> (C:\dev\project\starter-botkit-wa-middleware\node_modules\botbuilder-core\lib\botStatePropertyAccessor.js:43:42)
at Generator.next (<anonymous>)
at C:\dev\project\starter-botkit-wa-middleware\node_modules\botbuilder-core\lib\botStatePropertyAccessor.js:7:71
at new Promise (<anonymous>)
at __awaiter (C:\dev\project\starter-botkit-wa-middleware\node_modules\botbuilder-core\lib\botStatePropertyAccessor.js:3:12)
at BotStatePropertyAccessor.get (C:\dev\project\starter-botkit-wa-middleware\node_modules\botbuilder-core\lib\botStatePropertyAccessor.js:42:16)
at DialogSet.<anonymous> (C:\dev\project\starter-botkit-wa-middleware\node_modules\botbuilder-dialogs\lib\dialogSet.js:124:50)
(node:35088) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:35088) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Context:
Botkit is such garbage
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Because none of your developers are working on it or any of the other bugs.
@gp187 I tried this as well for web adapter. The testbot library comes with no instructions.. However, I was able to communicate with the bot through postman using this structure:
"{
"type": "message",
"text": "hello",
"channel": "websocket",
"user": "214124-1414-1111"
}"
Apparently, if the payload is missing some argument or the argument is wrong, it will output the error from above missing activity.conversation. Hope this helps.
Thanks @danielcirstea
"type", "text", "channel", "user" are required.
Most helpful comment
@gp187 I tried this as well for web adapter. The testbot library comes with no instructions.. However, I was able to communicate with the bot through postman using this structure:
"{
"type": "message",
"text": "hello",
"channel": "websocket",
"user": "214124-1414-1111"
}"
Apparently, if the payload is missing some argument or the argument is wrong, it will output the error from above missing activity.conversation. Hope this helps.