Un-block the chat interface on load
What does this MR do and why?
Previously, when fetching the cached messages for GitLab Duo Chat, we checked whether the last message is from user. And in this case, we assumed that the chat has been re-loaded mid-process while waiting for AI to respond. However, this mechanism creates a lot of issues in case the response errored out and didn't make it to cache while chat was reloading/closed freezing the interface and preventing users from asking questions.
This MR removes that mechanism and doesn't freeze the interface even if the last message if from user.
Screenshots or screen recordings
on chat loaf Before | on chat load After |
---|---|
How to set up and validate locally
- Follow the instructions to enable the AI features in your local GDK
- Follow the instructions on setting up the GitLab chat locally
- Enable the
:super_sidebar_nav
feature flag (Feature.enable(:anthropic_experimentation)
in your rails console - Enable the new super sidebar in your settings via the web interface:
- Open the GitLab chat in Help -> Ask GitLab Chat
- Ask a question (for example, "What is a fork?"), and DO NOT wait for the response - reload the page
- After the page reloads, open the chat again. If you did everything quickly:sweat_smile: you should still not see the AI response, not see the loading indicator, and the chat interface should allow you to send another question. Note: the possible appearance of the AI response while you type in the new question might happen.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #418190
Edited by Denys Mishunov