Skip to content

fix(chat): avoid duplicate pasted image attachments - #794

Open
LugMuad wants to merge 1 commit into
outsourc-e:mainfrom
LugMuad:fix/duplicate-pasted-image
Open

LugMuad wants to merge 1 commit into
outsourc-e:mainfrom
LugMuad:fix/duplicate-pasted-image

Conversation

@LugMuad

@LugMuad LugMuad commented Sep 11, 2026

Copy link
Copy Markdown

Summary

Fix duplicate image attachments when pasting an image into the chat composer.

Some browsers expose the same pasted image through both DataTransfer.files
and DataTransfer.items. The previous implementation collected files from both
sources, which could attach the same clipboard image twice because the resulting
File objects may have different metadata.

Prefer DataTransfer.files when available and use DataTransfer.items only as
a fallback.

Tested

  • Pasting a clipboard image now creates a single attachment.
  • Regular file attachment behavior is unchanged.

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.

1 participant