microsoft / sample-app-aoai-chatGPT

Sample code for a simple web chat experience through Azure OpenAI, including Azure OpenAI On Your Data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Responses Sent to Wrong Chat When Switching Between Chat History

santistelus opened this issue · comments

When sending a message in a chat and switching to another chat from the history before the response is received, an error occurs. The error is that the response from the initial chat is displayed in the second chat.

Steps to reproduce the behavior:

  1. Open 2 chats, which we will call Chat A and Chat B for this example.
  2. In Chat A, send a prompt.
  3. While the response is being generated, switch to Chat B.
  4. You will notice that the original response from Chat A is displayed in Chat B.

Expected behavior
Responses should only be shown in the chat where the prompt was made.

Configuration: Please provide the following

  • Text_model gpt-3_5-turbo-16k-0613
  • Is chat history enabled
  • Bing Search

@santistelus Can you confirm you are still experiencing this bug? Also, were you experiencing this locally or in a deployed app? Thanks.

Hi @iseabock Yes, i am still experiencing this bug... and it is happening in both environments, locally and in a deployed app.

@santistelus Can you make a screen recording of this? I'm having some trouble reproducing this bug.

@iseabock Here!
You may notice that I created two chats. In the first chat, I entered a prompt and then quickly switched to the second chat. Interestingly, I received the response from the first chat in the second chat.

Chatbot.Issue.mp4

Thanks for the screen recording @santistelus. I suspect this may be a side effect of customizations that have been made in your app. I am not able to get the same behavior that you are getting. In the video I have provided, although I do see the "Generating answer" message when I switch the previous chat (a bug I'll fix :)) I am brought back to the second chat when the response is generated.

Recording.2024-06-27.160931.mp4

I see... well do you mind sharing with me which file should i Review or any suggestions to solve this. :)
Also thanks a lot for the fast reply!

I think the files to check would be Chat.tsx and Answer.tsx and take a look at any async issues around currentChat.id and less likely but possibly answer.id. I hope that helps!