Skip to content

Un-block the chat interface on load

Denys Mishunov requested to merge 418190-unfreeze-interface into master

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
Screenshot_2023-07-20_at_14.23.50 Screenshot_2023-07-20_at_14.23.29

How to set up and validate locally

  1. Follow the instructions to enable the AI features in your local GDK
  2. Follow the instructions on setting up the GitLab chat locally
  3. Enable the :super_sidebar_nav feature flag (Feature.enable(:anthropic_experimentation) in your rails console
  4. Enable the new super sidebar in your settings via the web interface: Screenshot_2023-05-26_at_11.20.04
  5. Open the GitLab chat in Help -> Ask GitLab Chat
  6. Ask a question (for example, "What is a fork?"), and DO NOT wait for the response - reload the page
  7. 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.

Related to #418190

Edited by Denys Mishunov

Merge request reports