Botkit: startConversationWithUser doesn't work with emulator

Created on 22 Oct 2019  路  4Comments  路  Source: howdyai/botkit

Issue

According to core docs, startConversationWithUser(reference: ConversationReference) should work in the core without any adapter.

When I try to use it with the emulator, the async call to client.conversations.createConversation(parameters) inside botworker.ts seems to hang and the conversation is never started.

Demo

I made a simple working demo app here that you can clone to see the issue.

  1. Start the emulator
  2. Say "ref" to save a conversation reference to be used later (see console log output)
  3. The bot should automatically start a new conversation using the ref, but instead it hangs

Debugging info

Apparently after about 5 minutes, the socket hangs up with this dump:

Error: socket hang up
    at new RestError (botkit-issue-demos/node_modules/@azure/ms-rest-js/dist/msRest.node.js:1397:28)
{
  code: 'REQUEST_SEND_ERROR',
  statusCode: undefined,
  request:
   WebResource {
     url: 'http://localhost:52343/v3/conversations',
     method: 'POST',
     body:
      '{"isGroup":false,"bot":{"id":"342e1f30-f4fa-11e9-aad8-0d5bc2ce5f40","name":"Bot","role":"bot"},"members":[{"id":"a97ee945-eace-4201-a682-a45e2ed2af22","name":"User","role":"user"}],"activity":null,"channelData":null}',
  ...
}

It's unclear from the async stack trace where this request originates.

Context

  • Botkit version: 4.6.1
  • Messaging Platform: Emulator
  • Node version: 10.15.3
  • OS: Mac 10.14
bug

All 4 comments

Hrm!! I'll research.

Note this is still an issue in botkit v4.6, but the workaround described in https://github.com/howdyai/botkit/issues/1844 works well enough for my purposes.

I simply changed startConversationWithUser(ref) => changeContext(ref) and I can begin a convo with the emulator. Demo has been updated accordingly.

This does appear to be correct, and I believe represents a bug in the Bot Framework Emulator's implementation of the protocol and APIs.

I will open a bug on that project's repo and track it back here.

I have determined the root cause of this problem, and I am implementing a workaround for this in Botkit.

However, I also opened a bug in the emulator repo, and we should remove this workaround when it is fixed.

https://github.com/microsoft/BotFramework-Emulator/issues/2097

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JonnyBoy333 picture JonnyBoy333  路  3Comments

seriousssam picture seriousssam  路  3Comments

stelio picture stelio  路  4Comments

benbrown picture benbrown  路  3Comments

dfischer picture dfischer  路  4Comments