desktop icon indicating copy to clipboard operation
desktop copied to clipboard

Mac and Linux client should warn against syncing files/folders names which include trailing whitespace

Open sbgillett opened this issue 5 years ago • 11 comments

How to use GitHub

  • Please use the 👍 reaction to show that you want to have the same feature implemented.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Feature description

The Mac and Linux client should at least throw a warning when attempting to sync files or folders whose names include trailing whitespace. The current behaviour is that the Mac client will sync them up, but users on Windows with whom such files/folders have been shared will not be able to sync them down.

sbgillett avatar May 26 '21 15:05 sbgillett

IMHO this shouln not be implemented only on MAC and LINUX clients, but also as a warning on WIN .

I am using WIN client and this problem also happened to me,, ( in fact reported the similar issue with trailing dot (.) here on server repo #18066 ) Especially when considering that the server itself is *NIX and overall consideration that the whole concept of Nextcloud is the possibility to synch different users with different clients . Users should know when creating a folder that other users might not be able to synch them.

IMHO In that case also win client users should be alerted of the problem - and also if already implemented alert than also incorporate the trailing dot issue as well as other special characters that might present a problem..

k9t9 avatar May 27 '21 00:05 k9t9

@k9t9 Warnings in case files could not be created for Windows (and other platforms) are already implemented. But the fix will only come with 3.3. https://github.com/nextcloud/desktop/pull/3022

And jut for the record: From experience Windows does not allow a lot of characters in filenames in comparison to Linux and Mac. It will be impossible to warn the user about all characters that might be illegal on other platforms WHEN they going to be synced (because that are quite a lot and people will come up in the future with different filesystems that disallow different characters). The case that trailing whitespaces are created on macOS or Linux seems to happen quite often, and it's known that it causes issues on Windows (what the majority of users use). That's why I think it would be good to have this warning on Linux and Mac (or Unix systems in general) WHEN these files are synced. I know this is a little bit inconsistent, but I think it is better than nothing.

FlexW avatar May 27 '21 09:05 FlexW

You might be right,

but since it seems that the problem's scope is a bit wider than just trailing whitespace ( like above - also a trailing dot is just one example ) - && the core function of Nextcloud is actually the syncing BETWEEN different OS && given the fact that the majority of users will have a similar configuration to WIN desktop client <-> *nix server - than given all that I just thought that a more holistic and complete approach should be taken in this case and try to sanitize filenames ( with an option of user override of course for special cases ) should be taken - both on the client(s) AND the server side.

For example - in my case it already happened that someone created a folder from the Web interface ( on server ) with trailing dot - and that caused some users (mainly win ) to miss the whole folder and it's content - because no warning was given to the incompatible filename.

k9t9 avatar May 31 '21 02:05 k9t9

@k9t9 Your concerns are valid, but keep in mind that for the example you provided there gets now a warning displayed in the Windows client. This issue is about the other direction. If you want warnings in the web interface when creating files you need to file an issue on the server. Maybe we can throw warnings also on trailing dots, if that happens frequently.

FlexW avatar May 31 '21 08:05 FlexW

I still have the problem today is it normal ? The issue is not closed ? My nextcloud stops syncing at any file containing trailing space I am on ubuntu 20.04

masterleo avatar May 12 '22 18:05 masterleo

Does this prevent synchronization of such?

0009-0009-1013-986X avatar Aug 31 '22 13:08 0009-0009-1013-986X

Does this prevent synchronization of such?

The current behaviour is that the Mac client will sync them up, but users on Windows with whom such files/folders have been shared https://github.com/nextcloud/desktop/issues/707#issuecomment-845359000 will not be able to sync them down.

sbgillett avatar Sep 01 '22 02:09 sbgillett

@sbgillett, I don't quite understand what your response means. It appears to be missing half a sentence after “shared”. No worry:

Do you mean that Mac-clients are able to synchronize them, but are invisible for Windows-clients? If so, is Linux able to synchronize? I ask because the constant notifications are causing me to worry that my data is not being synchronized, and I utilize Linux.

0009-0009-1013-986X avatar Sep 01 '22 10:09 0009-0009-1013-986X

@BEEDELLROKEJULIANLOCKHART sorry, copy/paste fail; edited. Yes they're invisible to Windows clients. I haven't tested the situation on Linux. I ended up rolling a script to rename affected uploaded files on the server. It's a sledgehammer approach, but it works for me.

It's a quick and dirty script so YMMV and you'll need to adjust the paths for your environment, if you decided to use it.

sbgillett avatar Sep 03 '22 18:09 sbgillett

Can I fix this problem? I'm working on a project with my co-worker. I am Mac iOS user but, my coworkers are WIN users. So, When I made a repository with the folder name (without any . / * ? thing), they couldn't checkout and pull anything in my shared repository. Is it still the problem with whitespace(which is automatically created at the end of folder name on Mac)? Or it could fix now? Anyone finds out the solution with this problem?

oocho0 avatar Oct 10 '22 22:10 oocho0

Hello, this problem can be solved with the recently added server setting for windows compatibility. All clients will then work with this and act accordingly

https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/windows_compatible_filenames.html

Rello avatar May 09 '25 09:05 Rello