-
Notifications
You must be signed in to change notification settings - Fork 2.1k
small improvement to checking for image attachments #4543
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
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 adds an early media type check for image attachments in the Confluence connector to prevent unnecessary downloads of images when they are not allowed.
- Added early
media_type.startswith("image/")
check inconnector.py
to skip image downloads whenallow_images
is False - Removed redundant metadata access in
validate_attachment_filetype
function inutils.py
- Added TODO comment highlighting potential refactoring opportunity around file type validation consistency
- Improved logging messages to better explain why attachments are being skipped
2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
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.
minor note but lgtm
* small improvement to checking for image attachments * better comments * check centralized list of types instead of hardcoding them in the connector --------- Co-authored-by: Richard Kuo (Onyx) <rkuo@onyx.app>
* small improvement to checking for image attachments * better comments * check centralized list of types instead of hardcoding them in the connector --------- Co-authored-by: Richard Kuo (Onyx) <rkuo@onyx.app>
Description
Fixes https://linear.app/danswer/issue/DAN-1816/confluence-image-attachments-being-downloaded-unexpectedly
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.