Forum Discussion
soulglow
Nov 14, 2022Copper Contributor
Teams bot conversation history confusion
We are developing a teams tab + bot app. All in one. We send adaptive cards a few times a day to the user but are confused how bot conversations are stored. No matter what we remove they show up as w...
Sayali-MSFT
Microsoft
Nov 16, 2022soulglow -Here is one way, You can use the ConcurrentDictionary to add, retrieve, update, and remove items from a System.Collections.Concurrent.ConcurrentDictionary<TKey,TValue>. This collection class is a thread-safe implementation.
public ProactiveBot(ConcurrentDictionary<string, ConversationReference> conversationReferences, IConfiguration configuration)
{
_conversationReferences = conversationReferences;
_configuration = configuration;
}
private void AddConversationReference(Activity activity)
{
var conversationReference = activity.GetConversationReference();
_conversationReferences.AddOrUpdate(conversationReference.User.AadObjectId, conversationReference, (key, newValue) => conversationReference);
}
Reference sample -1. Microsoft-Teams-Samples/ProactiveBot.cs at 94b4bf9aea97eff41a8bf787cfb3974104745306 · OfficeDev/Microsoft-Teams-Samples (github.com)
2.Microsoft-Teams-Samples/proactiveBot.js at 9906633fe8c90a1c48f36f30f28ce00cb94c89ed · OfficeDev/Microsoft-Teams-Samples (github.com)
For the second query, We are checking with the engineering team and get back to you.
soulglow
Nov 16, 2022Copper Contributor
Hi. So your examples are all using C#, we don't know it and as I mentioned we use typescript/javascript. We don't know how to apply them.
My main question is how the conversation history is stored. I don't understand the difference between your first reply which uses DocumentDbBotDataStore and your second example which uses a dictionary. What's the connection between these 2 examples? Again, we're not C# developers.
May be you can describe:
1) if we don't specify any memory storage or documentdb storage, how come conversations never disappear?
2) if we had to write a custom one, what would we need to do in typescript? can you explain step by step?
My main question is how the conversation history is stored. I don't understand the difference between your first reply which uses DocumentDbBotDataStore and your second example which uses a dictionary. What's the connection between these 2 examples? Again, we're not C# developers.
May be you can describe:
1) if we don't specify any memory storage or documentdb storage, how come conversations never disappear?
2) if we had to write a custom one, what would we need to do in typescript? can you explain step by step?