How to reconnect to conversation using DirectLine App Service Extension?

泄露秘密 提交于 2021-02-11 15:05:28

问题


I am using the DirectLine 3.0.3-preview NuGet package to create a .NET client using DirectLine App Service Extension. I am able to establish a connection and start a new conversation via WebSockets using directLineClient.StreamingConversations.ConnectAsync(conversationId, receiveMessageCallback)

I am saving the conversationId generated from that session. However when I try to use that conversationId to create a new connection, I am not able to reconnect:

// Initialize a DirectLineClient using the secret.
var directLineClient = new DirectLineClient(
                           new Uri(_directLineEndpoint),
                           new DirectLineClientCredentials(_directLineSecret));

var conversation =  await directLineClient.Conversations
                             .ReconnectToConversationAsync(savedConversationId);

When I execute the code above, I get a null conversation object. This does not happen when I do the same approach before I moved to using App Service Extensions.

Is there a new way to reconnect to an existing conversation via WebSockets using DirectLine App Service Extension?


回答1:


So after researching further, it seems that DirectLine App Service Extension does not support message caching, as mentioned by answers and comments from this thread:

Direct Line App Extension - How and where are messages cached?



来源:https://stackoverflow.com/questions/63716073/how-to-reconnect-to-conversation-using-directline-app-service-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!