microsoft/BotFramework-DirectLineJS

Restart Conversation After 24 Hours

upul opened this issue · 2 comments

upul commented

Hi everyone,

we are developing an application that uses botframework SDK(version 4.11) python framework. We need the chat to reconnect to an incomplete conversation (the user can leave and reconnect to it after a few days). Currently, we are using Cosmos DB to persist the user-profile as well as state management as well as storing conversationIds in DB, instead of in-memory and a webchat in the frontend with Vuejs. By doing extensive research it is found that the direct line cache is only available for 24hrs. Is there a way to reload the conversation that is past 24hrs in the frontend using the conversationId?

I have followed some of the references given with no luck - #9

@upul, There are two ways that this can potentially be achieved. I say 'potentially' as the proposed options are relying on earlier versions of the SDK. As such, some classes and/or methods may have changed and will require updating code to current implementations. Doing so may result in a breaking change.

  • Option 1: This sample (referenced in this comment) in this very long GH issue, #365, demonstrates how conversation transcripts can be saved to Azure Blob Storage. The stored conversation history can then be uploaded via the SendConversationHistoryAPI.
  • Option 2: This option only works if you are using BotFramework-Webchat as the client. As you don't state which client is being used, I am putting this here should it be useful. In the same GH issue referenced above, you can see here that an array of activities (i.e. the conversation history) can be passed into the store in order to load a previous conversation into web chat.

In either case, please be aware that once a token has expired, it is not possible to get a refreshed token. So, while you may be able to load a previous (expired) conversation, it is not possible to resume that conversation. It is only possible to display the previous conversation with a new conversation following after it.

Closing due to lack of response.