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 chat image upload double read #3889

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

sam-w
Copy link
Contributor

@sam-w sam-w commented Feb 4, 2025

Description

Fixes #3888

There is a bug which breaks image uploads in chats:

Screenshot 2025-02-04 at 11 21 20 am Screenshot 2025-02-04 at 11 21 08 am

I believe this was caused by a change in 2ad86aa which causes an IO stream based on an image file to be read again without resetting the stream back to the beginning (first read in chat_backend.py, upload_files_for_chat, and then again in pg_file_store.py, create_populate_lobj). Non image files are treated differently and thus are unaffected.

How Has This Been Tested?

Tested both PDF and image uploading.

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.

  • This PR should be backported (make sure to check that the backport attempt succeeds)
  • [Optional] Override Linear Check

Copy link

vercel bot commented Feb 4, 2025

@sam-w is attempting to deploy a commit to the Danswer Team on Vercel.

A member of the Team first needs to authorize it.

@Weves
Copy link
Contributor

Weves commented Feb 5, 2025

Thanks for this fix!

@Weves Weves merged commit 526932a into onyx-dot-app:main Feb 5, 2025
1 of 9 checks passed
@sam-w sam-w deleted the bugfix/chat-image-upload branch February 5, 2025 23:15
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.

Can't upload images
2 participants