DirectLine Conversation Ids get expired?
We store conversation ids (direct line) against our application users which will be later used to resume conversations. However, when trying to resume a conversation after keeping them inactive for several days, directline service returns HTTP 404 error. Please refer the issue where it's mentioned that conversation ids do not expire. Is this the expected behavior?
Update: apparently conversation ids do now 'become unreachable after a few weeks of inactivity'.
https://github.com/Microsoft/BotFramework-DirectLineJS/issues/119#issuecomment-445066667
Conversation messages are only stored for 24 hours in DirectLine. Conversation metadata (such as conversation id and couple other housekeeping data) are removed after a period of inactivity (between 15 to 20 days).
Thanks for the update @EricDahlvang. Well, if that's case, the only option we have is to re-create conversations. Need to figure out a way to expire the user/conversation/private conversation state automatically as well. I'm thinking of using Time to live feature as we are using CosmosDB for state persistence. Is there a recommended approach?
I'm not aware of a recommended approach to expiring a conversation in Direct Line. Using time-to-live sounds like a great idea for the bot and storage side. Something else might be required for the client.
I'm closing this, as the question has been answered. Thank you for opening this issue. I was not aware of the protocol change with expiring conversation ids until today. (I've updated my previous comment)
We will update the client accordingly. Many thanks @EricDahlvang.
Then how can we handle the old conversation data of the user, if we need to show the transcript history of the user. Is there any recommended way of that ?
@neetibirla If you use TranscriptLoggerMiddleware and a Transcript Store implementation, you can retrieve conversation history at any time and send it to the Direct Line service using the SendConversationHistory API. A Node.js example can be found in this closed pull request: https://github.com/Microsoft/BotBuilder-Samples/pull/1266
Mapping multiple conversations to a single user, and managing conversations with conversation history for a specific user is left to the developer.