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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sam-w
Copy link

@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.

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
1 participant