Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No response after conversation creation #2

Open
codingcronus opened this issue Jul 26, 2017 · 10 comments
Open

No response after conversation creation #2

codingcronus opened this issue Jul 26, 2017 · 10 comments
Assignees

Comments

@codingcronus
Copy link

codingcronus commented Jul 26, 2017

Hi, thank you for a great library :-)

I'm running into an issue. I have:

  1. A custom WebChat component from https://github.com/Microsoft/BotFramework-WebChat running on port 8000.
  2. A .NET Bot Webservice running on port 3979
  3. Your sample where I have just changed 3978 to 3979

When re-loading the WebChat component, I can see that your service creates a new conversation id with a random guid.
When sending a message via the WebChat, I can see via Fiddler that the message is correctly posted to your service (the activities endpoint), but it never responds and eventually times out.

I have also tried to replace my .NET Bot Webservice with a very simple Node.js Bot Webservice (the one from https://docs.microsoft.com/en-us/bot-framework/nodejs/bot-builder-nodejs-quickstart).
I can see that your service correctly post the message to the web service, but then I get the following error: "ERROR: ChatConnector: receive - no security token sent.". In the BotBuilder SDKs ChatConnector I edited the code to skip the token check:

ChatConnector.prototype.verifyBotFramework = function (req, res) {
   var _this = this;
   _this.dispatch(req.body, res);

   return;
}

And then the Bot Webservice (Node.js) replies correctly. This leads me to think that it's a security issue and since I do not have the source code for .NET BotBuilder SDK, I cannot skip the token verification, which means that I cannot use my .NET Bot Webservice and instead have to rewrite it to Node.js...

I hope you can help me :-)

@ryanvolum
Copy link
Owner

Sorry you're having issues @Tigerdyret! This sample actually takes all messages and gives them a channelId of "emulator" which should be skipping any token checking. That said, I haven't tested the package with a C# bot, so I'll see if I can get one working.

Did you change the websockets variable (in your directline instantiation in your webchat project) to false? Also, are you running the offline connector via the npm script command or through code?

@codingcronus
Copy link
Author

Hi @ryanvolum
Thank you. Yes, I did change the websockets setting to false, so I guess that's not the issue here.
Did you get a chance to test using a C# based bot? :-)

@ryanvolum
Copy link
Owner

I have and it seems to be working for me! I just tested on the Echo Bot sample (crazy simple) and just had to update the hostname I passed into initializeRoutes to reflect the project I was hosting on. Sorry you're still having trouble - can you try with the EchoBot (in case your bot is somehow doing something above and beyond)?

@ryanvolum ryanvolum self-assigned this Aug 8, 2017
@Matti-Koopa
Copy link

I'm having the same problem.
The node output says "Created conversion with conversationId: xxx" but the breakpoint in "Post" or "HandleSystemMessage" in the running debugging C# project never get's hit.

@Matti-Koopa
Copy link

Matti-Koopa commented Aug 16, 2017

Fixed it: Apparently you HAVE to specify a BotId in web.config.
<add key="BotId" value="aaa" />
Add this to your WebChat like:
http://localhost:3978/BotFramework-WebChat/samples/fullwindow/index.html?domain=http://localhost:3000/directline&botid=aaa

Still doesn't send system message though. The original emulator sends an initial "ConversationUpdate" message. This one doesn't.
My message get's stuck at await Conversation.SendAsync(activity, () => new RootDialog()); and never even reaches the constructor of RootDialog.

@rainmakerho
Copy link

I use c# echo bot project. i got Autofac.Core.Resolving.ResolveOperation.Execute Error below,
Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable1 parameters) Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable1 parameters)
Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable1 parameters, Object& instance) Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable1 parameters)
Autofac.ResolutionExtensions.Resolve[TService](IComponentContext context, IEnumerable`1 parameters)
Autofac.ResolutionExtensions.Resolve[TService](IComponentContext context)
Microsoft.Bot.Builder.Dialogs.Conversation.d__11.MoveNext()

I use node echo bot project. The webchat won't get bot's echo message.
Created conversation with conversationId: 7b8f1802-2bc6-4950-a7ad-2f900d1e81d4
Called GET user data
Data key: $emulator!!userid
Called GET private conversation data
Data key: $emulator!7b8f1802-2bc6-4950-a7ad-2f900d1e81d4!userid
Called GET conversation data
Data key: $emulator!7b8f1802-2bc6-4950-a7ad-2f900d1e81d4!

Fiddler tool got 404 code from
OPTIONS http://localhost:3000/directline/conversations/7b8f1802-2bc6-4950-a7ad-2f900d1e81d4?watermark=

@b4usat
Copy link

b4usat commented Aug 21, 2017

@ryanvolum Message is properly delivered to the bot but could able to retrieve the response. Not sure how it will work. Can you please guide me?
capture

@ryanvolum
Copy link
Owner

Apologies for not keeping up with this. It seems that the C# SDK is making an OPTIONS call against /directline/conversations/:conversationId which the Node SDK is not. The resolution should be to create a new route in bridge.ts for app.options. I'll investigate further if I have the chance

@Matti-Koopa
Copy link

Is there any update on this?

@pradeepdeepu
Copy link

Hi Ryanvolum,

As you mentioned in C# SDK there is a call the URL : http://127.0.0.1:3000/directline/conversations.
I'm badly in need of this fix. Let me know if there is a fix for this.

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

No branches or pull requests

6 participants