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.
I made a simple working demo app here that you can clone to see the issue.
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.
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