Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

startConversationWithUser doesn't work with emulator #1834

Closed
cooperka opened this issue Oct 22, 2019 · 4 comments · Fixed by #1929
Closed

startConversationWithUser doesn't work with emulator #1834

cooperka opened this issue Oct 22, 2019 · 4 comments · Fixed by #1929
Assignees
Labels
Milestone

Comments

@cooperka
Copy link
Contributor

cooperka commented Oct 22, 2019

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
@benbrown benbrown self-assigned this Oct 24, 2019
@benbrown
Copy link
Contributor

Hrm!! I'll research.

@cooperka
Copy link
Contributor Author

Note this is still an issue in botkit v4.6, but the workaround described in #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.

@benbrown benbrown added the bug label Nov 20, 2019
@benbrown benbrown added this to the 4.6.+ milestone Nov 20, 2019
@benbrown
Copy link
Contributor

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.

@benbrown
Copy link
Contributor

benbrown commented Mar 11, 2020

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.

microsoft/BotFramework-Emulator#2097

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants