botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

[Question] Multiple users getting the same answer on different queries at the same time

Open msBot1111 opened this issue 9 years ago • 7 comments

My Bot is implemented in c#, and the main dialog is LUIS Dialog. So I've detected when different users in the same time ask the bot different queries, the bot detects just one query from the one user and replays the same answer to the both users. I've integrated the bot in skype and in my xamarin app. So, how can I detect more queries in the same time. I'm using chain dialog like this: internal static IDialog MainRoot() { return Chain.From(() => new MainDialog()); // Main dialog is LUIS Dialog // public class MainDialog : LuisDialog } await Conversation.SendAsync(activity, MainRoot);

msBot1111 avatar May 19 '17 08:05 msBot1111

I had a similar issue!! But mine was a total blunder from my side!!!! Mine was because I used some static properties!!

PrasadGautham avatar May 22 '17 05:05 PrasadGautham

I use static properties too. Are you saying that's because of them? @PrasadGautham

msBot1111 avatar May 22 '17 07:05 msBot1111

To me that was the issue....I was storing a particular variable through a static property.....So this value was changing with context to the whole users and not just an individual...So I think we used conversationdata to store that....Am not sure if thats the case with you as well... Let the experts say!!! I am not very well aware

PrasadGautham avatar May 22 '17 07:05 PrasadGautham

Yeah, static properties persist their data over multiple messages. Try and avoid static if you don’t want this behaviour

Sent from my Windows 10 phone

From: msBot1111 Sent: 22 May 2017 07:13 To: Microsoft/BotBuilder Cc: Subscribed Subject: Re: [Microsoft/BotBuilder] [Question] Multiple users getting the sameanswer on different queries at the same time (#2800)

I use static properties too. Are you saying that's because of them? @PrasadGautham — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

michaelhutchful avatar May 22 '17 07:05 michaelhutchful

@msBot1111 please post more code, so we can help determine what the issue is.

EricDahlvang avatar May 22 '17 17:05 EricDahlvang

@msBot1111 did your issue get resolved?

JasonSowers avatar May 31 '17 23:05 JasonSowers

yes I did, thanks. The issue was with the static properties.

msBot1111 avatar Jun 01 '17 07:06 msBot1111