Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add brain missing message #958

Merged
merged 1 commit into from
Aug 16, 2023
Merged

feat: add brain missing message #958

merged 1 commit into from
Aug 16, 2023

Conversation

mamadoudicko
Copy link
Contributor

Description

Screen.Recording.2023-08-16.at.10.42.07.mov

@mamadoudicko mamadoudicko temporarily deployed to preview August 16, 2023 08:46 — with GitHub Actions Inactive
@vercel
Copy link

vercel bot commented Aug 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs 🔄 Building (Inspect) Visit Preview Aug 16, 2023 8:46am
quivrapp 🔄 Building (Inspect) Visit Preview Aug 16, 2023 8:46am

@github-actions
Copy link
Contributor

Risk Level 2 - /home/runner/work/quivr/quivr/frontend/app/chat/[chatId]/hooks/useChat.ts

The code changes are generally safe and follow good practices. However, there are a few areas that could be improved for better readability and error handling:

  1. Error Handling: The error handling could be improved. Currently, the error is just logged to the console and a generic error message is shown to the user. It would be better to provide more specific error messages based on the type of error that occurred. This would help in debugging and also provide a better user experience.

    } catch (error) {
      const axiosError = error as AxiosError;
      if (axiosError.response?.status === 429) {
        publish({
          variant: \"danger\",
          text: t(\"limit_reached\", { ns: \"chat\" }),
        });
      } else {
        publish({
          variant: \"danger\",
          text: t(axiosError.message, { ns: \"chat\" }),
        });
      }
    }
  2. Use of void: The use of void before track(\"QUESTION_ASKED\") is unnecessary and can be removed for cleaner code.

    track(\"QUESTION_ASKED\");
  3. Use of useState: The useState hook is used to store the chatId and generatingAnswer states. However, it's not clear if these states are used elsewhere in the component. If they are not, it might be better to use regular variables instead of state variables to avoid unnecessary re-renders.


🔧💬🔄


Powered by Code Review GPT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants