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

fix: remove fix/backend-tests-3 conflicts #998

Merged
merged 1 commit into from
Aug 21, 2023

Conversation

mamadoudicko
Copy link
Contributor

Description

@mamadoudicko mamadoudicko temporarily deployed to preview August 21, 2023 10:57 — with GitHub Actions Inactive
@vercel
Copy link

vercel bot commented Aug 21, 2023

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

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 21, 2023 11:04am
quivrapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 21, 2023 11:04am

@github-actions
Copy link
Contributor

github-actions bot commented Aug 21, 2023

Risk Level 3 - /home/runner/work/quivr/quivr/backend/routes/chat_routes.py

  1. The delete_chat_from_db function is catching all exceptions and simply printing them. This is not a good practice as it can make debugging difficult. It would be better to log the exceptions with more context or re-raise them after logging. For example:
try:
    supabase_db.delete_chat_history(chat_id)
except Exception as e:
    logger.error(f'Failed to delete chat history for chat_id {chat_id}: {e}')
    raise
  1. The check_user_limit function has an else clause that does nothing. This is unnecessary and can be removed.
  2. The create_question_handler and create_stream_question_handler functions are very long and complex. Consider breaking them down into smaller, more manageable functions.
  3. The create_question_handler and create_stream_question_handler functions are retrieving the user's OpenAI API key from the request headers. This is a potential security risk as it exposes the API key in the request. Consider using a more secure method to handle API keys.
  4. The create_question_handler and create_stream_question_handler functions are using print statements. It would be better to use a logger to provide more context and control over the output.
  5. The create_question_handler and create_stream_question_handler functions are catching HTTPException and then re-raising it. This is unnecessary and can be removed.

🔒🔧📚


Powered by Code Review GPT

@mamadoudicko mamadoudicko merged commit f61b70a into main Aug 21, 2023
3 of 6 checks passed
B0rrA pushed a commit to B0rrA/quivr that referenced this pull request Aug 22, 2023
StanGirard pushed a commit that referenced this pull request Sep 12, 2023
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.

None yet

2 participants