Bug 470078 - File sharing will fail when transferring multiple files with same name.
Summary: File sharing will fail when transferring multiple files with same name.
Status: RESOLVED FIXED
Alias: None
Product: kdeconnect
Classification: Applications
Component: common (other bugs)
Version First Reported In: 23.04.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Albert Vaca Cintora
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-21 07:56 UTC by rqirufea
Modified: 2023-05-25 22:54 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rqirufea 2023-05-21 07:56:09 UTC
SUMMARY
When sharing files, particularly from from the Photos app on iPhones, sometimes two files can have same file name despite being seperate files. In the iPhone's case, changing the file names in the Photos app isn't possible.


STEPS TO REPRODUCE
1. select "Send Photos and Videos" option in KDE Connect iOS app.
2. select a specific set of photos and videos.
3. tap "Add" to begin transferring.

OBSERVED RESULT
Failed transfer with a message about filenames being the same

EXPECTED RESULT
Those files with the same name being renamed like: IMG_1234.JPG, IMG_1234-1.JPG

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: EndeavourOS, Linux kernel 6.3.2
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.106.0
Qt Version: 5.15.9
Comment 1 Bug Janitor Service 2023-05-25 00:13:58 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/kdeconnect-kde/-/merge_requests/544
Comment 2 Albert Vaca Cintora 2023-05-25 22:54:39 UTC
Git commit 571575df28af878ccbe5abc91440f8d1fc36727a by Albert Vaca Cintora.
Committed on 25/05/2023 at 22:54.
Pushed by albertvaka into branch 'master'.

When receiving files, delay de-duplicating filenames

When receiving two files with the same name, the first file might not be
saved to disk already when we have to decide the name for the second if
we do it too early.

M  +13   -4    core/filetransferjob.cpp
M  +5    -0    core/filetransferjob.h
M  +1    -4    plugins/share/shareplugin.cpp

https://invent.kde.org/network/kdeconnect-kde/-/commit/571575df28af878ccbe5abc91440f8d1fc36727a