fix: Dropping a file from another browser window creates two upload dialogs - #31332
Conversation
🦋 Changeset detectedLatest commit: 0cb0583 The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #31332 +/- ##
===========================================
- Coverage 48.94% 45.31% -3.64%
===========================================
Files 3289 3204 -85
Lines 81002 75232 -5770
Branches 16597 15283 -1314
===========================================
- Hits 39647 34091 -5556
- Misses 36693 36730 +37
+ Partials 4662 4411 -251
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
Did you understand why it's creating two files? I think that we need to fix this problem instead of resolving this issue in our application |
|
Yes I have @hugocostadev. However, if the request is made, a new file containing the identical picture is created and added to the files array that previously included the image, resulting in the creation of a duplicate file. The problematic code has been commented out, and practically all cases for drag and drop runs normally. Would you kindly let me know if I missed any cases and how do you want me to approach the situation with the duplicate files? |
|
@Sayan4444 I could not reproduce this issue in any browser... maybe it's a OS and/or browser issue, I'll try to reproduce on windows and some other browsers I'm using MacOS |
|
@hugocostadev can you check from this website, |
|
For me does not work but a windows user tested and it was able to reproduce, I'll accept your solution! Thanks |


Proposed changes (including videos or screenshots)
BEFORE THE FIX
https://github.com/RocketChat/Rocket.Chat/assets/112304873/a6f0faf1-cd9a-480d-bbe1-c60044d10205
AFTER THE FIX
https://github.com/RocketChat/Rocket.Chat/assets/112304873/d59fb5c2-9fcd-40fc-9630-8386a0712520
REASON BEHIND CHANGES
We are comparing the files by their size in bytes and checking for any duplicate files as it is very hard to find files of same size.We can also use nodejs to check but it takes a bit longer for long files.If you want the nodejs version please do tell me.
Issue(s)
This should close issues :-
closes #30793
Steps to test or reproduce
Open a Rocket.Chat channel in one Chromium window.
Open the image to be drag-and-dropped in another Chromium window.
Drag the image and drop it into the Rocket.Chat channel.