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

Does not warn on rename #137

Open
timmc opened this issue Sep 22, 2021 · 5 comments
Open

Does not warn on rename #137

timmc opened this issue Sep 22, 2021 · 5 comments

Comments

@timmc
Copy link

timmc commented Sep 22, 2021

If I create a fresh Davros grain and rename shuttle.jpg to pluto.jpg, pluto.jpg is overwritten. This matches the behavior of Unix's mv command, but should probably issue a warning/confirmation dialog.

(This is with experimental version 0.31.1.)

@mnutt
Copy link
Owner

mnutt commented Sep 23, 2021

That's a good call-out, I'll add a warning if the rename will potentially overwrite an existing file.

@ocdtrekkie
Copy link
Contributor

Not tested, but can I assume it may do the same if you move pluto.jpg into a folder where a pluto.jpg already exists?

@timmc
Copy link
Author

timmc commented Sep 23, 2021

Yes, same result.

@timmc
Copy link
Author

timmc commented Sep 23, 2021

I wonder if it would also be worth doing a second check during the actual file move/rename operation, like so:

  1. Grain loaded
  2. User attempts to rename aaa.jpg to xxx.jpg (where xxx.jpg does not exist)
  3. [At some point since UI load, an xxx.jpg is uploaded]
  4. Second check happens just before the mv operation
  5. "Error: xxx.jpg already exists"

@mnutt
Copy link
Owner

mnutt commented Sep 29, 2021

The WebDAV spec handles MOVE conflicts by passing a header Overwrite: T or Overwrite: F. I think perhaps the right thing to do is to attempt to do the MOVE with Overwrite: F and catch the error, prompting to overwrite or cancel.

This works fine on single-file moves or renames, but is going to be tricky on files where many files may end up with conflicts...

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