Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
andor-pierdelacabeza opened this issue Jul 10, 2024 · 2 comments
Open

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

andor-pierdelacabeza opened this issue Jul 10, 2024 · 2 comments

Comments

@andor-pierdelacabeza
Copy link

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:

MustDifferFrom: (original) => {
return (value) => {
if(value && value.toLowerCase() === original.toLowerCase()) {
throw new Error('rename.newvalue.error.similar')
}
}
},

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

  • Using a case sensitive storage (so file names shouldn't collide)
  • Using flat storage (so file names won't collide anyway as they're all unique)

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

  • Debian 12
  • ext4 fs
  • Pydio Cells Home Edition 4.4.3
  • Flat storage
  • local MySQL DB

Question

Does it make sense to:

  • Remove the lower case comparison from that test...
  • ...or having a configuration option to disable it?
@bsinou
Copy link
Collaborator

bsinou commented Jul 18, 2024

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

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 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants