问题
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