pydio / cells

Future-proof content collaboration platform
https://pydio.com
GNU Affero General Public License v3.0
1.77k stars 172 forks source link

File and folder rename won't allow to change case #575

Open andor-pierdelacabeza opened 1 month ago

andor-pierdelacabeza commented 1 month ago

Problem

If I want to change case for one or several letter of one of my files or folders ( e.g, I want to rename from test-Alvaro to test-alvaro) it won't allow me as if the two file names were the same:

cells-rename

From what I've seen, this is due to one of the React prompt validators switching everything to lower case before comparing the strings:

https://github.com/pydio/cells/blob/0acafc8281a0ee0a8d29d259cd309d208fa52683/frontend/front-srv/assets/gui.ajax/res/js/ui/ReactUI/modal/PromptValidators.js#L29-L35

This shouldn't be a problem as we're:

This looks like just a frontend check that maybe has a technical reason, or maybe not. Does it?

Meanwhile I'm changing the file name to an intermediate one (e.g. test-Alvaro --> test-something --> test-alvaro) and that works, but it's a bit of a hassle, so I'd like to know...

Setup

Question

Does it make sense to:

bsinou commented 1 month ago

Hi.

Thanks for the detailed feedback. Yet, we know this limitation that is there since the v1. Last time I checked, it was not a limitation on the Javascript, but rather a necessary check to prevent problems that are quite complicated on the server side.

We are currently reworking on the DB storage layers and many things will change in the deep layers of the server for the v5. We will try to have another look at this when it's done and we might be able to tackle this then. But I must admit it is not very high in the "wish list".

In the meantime, I also have to go through the same process each time I make a "case" typo: I know the pain :)

alvarogonzalez-packlink commented 1 month ago

Thanks @bsinou for the info! I'll do that meanwhile...

And now that you said that, I just noticed something: I haven't tried doing it using any of the APIs. Is this just a frontend check? Does it fail if I do it via API?

So, to refresh it for both of us I just tested it:

Cells API

To rename I do the same operation that the frontend does, a move operation. So, renaming from testing to Testing like this:

{
  "nodes": [
    "alvaro/testing"
  ],
  "target": "alvaro/Testing",
  "targetParent": false
}

Result:

It answers with a proper job {"JobUuid":"copy-move-6c4be44a-55ef-4b5d-ae44-9e6f6f1a8982"} but the result is a folder with the name Testing-1 😭

WebDAV API

Using the Cyberduck client, I try to rename testing to Testing... and it works! The change appears instantly in Cells web interface 👌

S3 API

Couldn't make it work, but I think it's either a problem with my client configuration or a limitation of the S3 API. I haven't had time to check it slowly... 🤷


Seems like the WebDAV API at least allows it. I have some WebDAV clients going around, so I hope there aren't any surprises waiting for me in the server if people begin to rename files using WebDAV 😆