-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Bugfix/delete document tags slow #4232
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR optimizes document tag deletion performance and modifies email header handling, with key changes focused on query efficiency and email configuration.
- Improved orphan tag deletion in
/backend/onyx/db/tag.py
by replacing outer join/group by with a more efficient NOT EXISTS subquery - Added conditional 'From' header check in
/backend/onyx/auth/email_utils.py
that needs review as missing headers could cause email delivery failures - Query optimization removes dependency on SQLAlchemy's
func
module while maintaining correct tag identification
2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
if mail_from: | ||
msg["From"] = mail_from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Removing the 'From' header when mail_from is None will cause email delivery failures. The 'From' header is required by SMTP. Should use EMAIL_FROM as fallback instead.
if mail_from: | |
msg["From"] = mail_from | |
msg["From"] = mail_from or EMAIL_FROM |
Description
Fixes DAN-1543.
https://linear.app/danswer/issue/DAN-1543/slow-doc-tag-deletion-contributor
Credit to @ThomaciousD - #4192
How Has This Been Tested?
[Describe the tests you ran to verify your changes]
Backporting (check the box to trigger backport action)
Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.