RocketChat / RocketChat/Rocket.Chat

Drag-and-drop upload fails to upload multiple files with the same size

Open
#38,108 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

When dragging and dropping multiple files with the same file size into a channel, only one file gets uploaded. The deduplication logic uses only file.size as the unique key, causing files with identical sizes to be treated as duplicates and silently ignored.

Steps to reproduce:
  1. Create two text files with the same size but different names and content (e.g., echo "Hello World 123" > file1.txt and echo "Different Text!" > file2.txt - both 16 bytes)
  2. Open any channel, team, or direct message
  3. Drag and drop both files simultaneously into the message input area
Expected behavior:

Both files should be uploaded and appear in the chat.

Actual behavior:

Only one file is uploaded; the second file with the same size is silently ignored.

https://github.com/user-attachments/assets/b52a8c32-1e70-45b5-98f5-683241b98089

Server Setup Information:
  • Version of Rocket.Chat Server: 8.1.0-develop
  • Operating System: Fedora Workstation 41
  • Deployment Method: Local development
  • NodeJS Version: 22.16.0
Client Setup Information
  • Desktop App or Browser Version: Chrome
  • Operating System: Fedora Workstation 41
Additional context

The deduplication logic in useFileUploadDropTarget.ts uses file.size as the unique key, which causes different files with the same size to be incorrectly filtered out as duplicates.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with useFileUploadDropTarget.ts, where the issue says file deduplication is based on file.size. Reproduce the drag-and-drop case with two different same-size files, then verify that both files appear in the chat and that genuinely duplicate inputs still behave as intended.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.