nextcloud / desktop

💻 Desktop sync client for Nextcloud
https://nextcloud.com/install/#install-clients
GNU General Public License v2.0
2.97k stars 784 forks source link

[Bug]: Mac Os FileProvider: file and folder names containing "._" get truncated #5697

Closed marcotrevisan closed 1 week ago

marcotrevisan commented 1 year ago

⚠️ Before submitting, please verify the following: ⚠️

Bug description

This issue is a spin-off of #1337 @claucambra I found a small file naming glitch and was able to reproduce it. Folders containing "._" in their name get their name truncated once synced (unless there are also spaces in the name, in which case the folder will show up correctly). For example, "5._TEST" will show up in Finder as "5".

To reproduce it I created the following folders:

What happened at first is:

But after a while, those folders in Finder were showing up as follows:

Fortunately, their contents are OK. Updates to their content works as if nothing strange has happened.

on the NC server filesystem side they show up as follows:

drwxr-xr-x 2 www-data www-data 4096 Apr 12 11:17  5._TEST_NO_SPC
drwxr-xr-x 2 www-data www-data 4096 Apr 12 11:17 '6._TEST W SPC'
drwxr-xr-x 2 www-data www-data 4096 Apr 12 11:18  7._TEST_NO_SPC2

and here is the difference: the one with spaces is deliminted by ' characters which seems to stop the harmful name processing.

More info on the above.

  1. The same happens if I "touch" a regular file.
  2. In a terminal window, 'ls -l' shows the correct file and folder names, so this seems to be a Finder issue somehow.
ls -lc
total 0
-rw-------@ 1 marco  staff  799 12 Apr 15:35 3._TESTFILE1.drawio
-rw-------@ 1 marco  staff  797 12 Apr 15:35 4._TEST FILE.drawio
drwx------@ 3 marco  staff   96 12 Apr 12:10 5._TEST_NO_SPC
drwx------@ 2 marco  staff   64 12 Apr 15:37 6._TEST W SPC
drwx------@ 2 marco  staff   64 12 Apr 15:37 7._TEST_NO_SPC2
-rw-r--r--@ 1 marco  staff    0 12 Apr 16:07 8._PROVAFILE2
Schermata 2023-04-12 alle 17 45 10

Steps to reproduce

To reproduce it I created the following folders:

Expected behavior

No file and folder name patterns are processed.

Which files are affected by this bug

FIles and folders matching particular patterns in their name

Operating system

Mac OS

Which version of the operating system you are running.

12.6.5 "Monterey"

Package

Other

Nextcloud Server version

25

Nextcloud Desktop Client version

MacOS VFS Beta (1 and 2)

Is this bug present after an update or on a fresh install?

Updated from a minor version (ex. 3.4.2 to 3.4.4)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

Are you using an external user-backend?

Nextcloud Server logs

No response

Additional info

No response

marcotrevisan commented 1 year ago

Hi @claucambra sorry if I use a comment to this ticket to ask this. I'd like to contribute to the FileProvider enabled client (not a Swift expert but I'd like to learn and fix/improve stuff). Is there any pointer on how to setup a dev environment for the client?

Thanks in advance and regards!

marcotrevisan commented 1 year ago

This seems to be a Finder visualization issue, which I was able to solve in Finder settings, by enabling the Show file extensions option.

Sorry I haven't figured it out before.

marcotrevisan commented 1 year ago

Practically, a dot followed by any word without spaces is viewed as the "extension" for a file/folder name in Finder. If there's a space anywhere after the dot, then Finder treats it as part of the name. I didn't know this was also true for folders.

claucambra commented 1 year ago

Ah, happy to hear! :)

marcotrevisan commented 2 months ago

We've checked that other FileProvider implementations (i.e. G Drive) seem to handle this case correctly without having to force the "show all file extensions" in Finder. Seems like there's some way to tell Finder not to process the extensions on folder names under the "mount point" in CloudStorage....

marcotrevisan commented 1 week ago

Tested on 3.14.0-rc1, the issue does not show up. Unchecked the Finder configuration flag "Show all file extensione". Closing the issue.