BotFramework-WebChat icon indicating copy to clipboard operation
BotFramework-WebChat copied to clipboard

Keep conversationId and userID when opening chat in new tab

Open serpino opened this issue 8 years ago • 3 comments

Bot Info

  • SDK Platform: .NET Core
  • SDK Version: Core
  • Active Channels: WebChat, DirectLine
  • Deployment Environment: Azure Bot Service, Azure App Service, Bot Emulator

Issue Description

I want to host the chat within our website. In this web there are links that open the web in another tab. When I open the chat in a new tab, I receive in the message type conversationUpdate, a different conversationID and userID, when in fact it is the same user following the same conversation.

Is there any way that if that chat opens in different tabs of the browser is considered the same conversation?

P.D: I'm integrating the chat with directLine so I can customize the css and js files if necessary. Thanks!

serpino avatar May 25 '18 09:05 serpino

Hi. Can you help me please?

Thanks

serpino avatar May 28 '18 07:05 serpino

Preservation and continuation of history is not quite working today. We are planning to make it a feature in coming milestone.

In the meanwhile, I think you need to manipulate the DirectLineJS object to achieve that. Instead of passing a botConnection into Web Chat, you pass a directLine object in.

I have some old code trying to explore the area, may be it is helpful for you.

directLine={{
  conversationId: this.state.conversationID,
  domain: 'http://localhost:3001/mock',
  secret: null,
  streamUrl: this.state.conversationID ? 'http://nostreamsupport' : null,
  token: this.state.conversationID ? 'null' : null,
  watermark: this.state.watermark,
  webSocket: false
}}

compulim avatar Jun 14 '18 07:06 compulim

Related to https://github.com/Microsoft/BotFramework-WebChat/issues/365, please refer to that issue for tracking. :)

corinagum avatar Nov 29 '18 18:11 corinagum