nextcloud / ios

📱 Nextcloud iOS App
https://itunes.apple.com/us/app/nextcloud/id1125420102
GNU General Public License v3.0
1.98k stars 883 forks source link

Upload Error Due to Duplicate File Names with Custom File Name Format #2948

Open K-Tatsuya514 opened 4 months ago

K-Tatsuya514 commented 4 months ago

I am Japanese and not very proficient in English, so I apologize if there are any mistakes in my writing. Thank you for your understanding.

Steps to reproduce

  1. Enable automatic upload settings in the Nextcloud iOS app.
  2. Set the file name mask to "YY-MM-DD HH-mm-ss".
  3. Upload multiple files created at the same date and time, where the 5th to 8th characters of the file name are the same. (For example, files created on January 1, 2024, at 10:00:15 with file names like "20240101100015-0001" and "20240101100015-0002".)

Expected behaviour

File names should not duplicate, uploads should occur without errors, and files should not be overwritten.

Actual behaviour

File names duplicate, causing upload errors and resulting in file versioning where files are overwritten.

Screenshots

Logs

If a large number of files are affected by this event, a file lock is performed and logging is generated on the server side.

FileLocked
"Photos/24-01-01 00-00-00 0001.jpg" is locked, existing lock on file: 2 shared locks

Reasoning or why should it be changed/implemented?

In the current setting, when photos or videos taken from other media or downloaded from LINE are uploaded, the 5th to 8th characters of the file name are used, causing files taken on the same date and time to have the same name, resulting in upload errors. This reduces user convenience. It would be helpful if the original file name could be used when the file name format is specified, or if the original file name could be used when the prefix is not "IMG_".

Environment data

iOS version: iOS 17.5.1

Nextcloud iOS app version: 5.3.1.2

Server operating system: AlmaLinux 9.4 (Seafoam Ocelot)

Web server: Apache

Database: MariaDB version: 10.5.22

PHP version: 8.2.14

Nextcloud version: Nextcloud Hub 8 (29.0.2)

Biswa-bob commented 4 months ago

Appending UUID along with the custom name while uploading data will able to solve this problem

K-Tatsuya514 commented 4 months ago

Thank you for suggesting the use of UUIDs, that sounds like a good approach.

I'm wondering if it would be better to implement this change on the server side through a custom application hook, or if it would be more effective to address this on the iOS app itself. Could you provide some guidance on the recommended approach?

Thank you again!