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

[Bug]: Data lost when moving to parent folder with the same name (conflict modal resolve with all new files) #49621

Open
4 tasks done
andrey18106 opened this issue Dec 3, 2024 · 3 comments · May be fixed by #49966
Open
4 tasks done

Comments

@andrey18106
Copy link
Contributor

andrey18106 commented Dec 3, 2024

⚠️ This issue respects the following points: ⚠️

Bug description

When moving a folder to a parent folder which contains another folder with the same name may result in data loss. Reproducible both on stable NC30 and latest master.

Steps to reproduce

  1. Create test folder "Test"
  2. Create "New folder" inside test folder ("Test/New Folder"), put some files
  3. Create "New folder" inside "Test/New folder", put some files
  4. Move "Test/New folder/New folder" to parent ("Test/New folder") / or move the same name folder "New folder" from other place to "Test/New folder"
  5. In conflict dialog choose "Select all new files"
  6. See "Move or copy action failed" toast, the parent folder "Test/New folder" gets deleted, or if moved from other place, the "New folder" gets deleted.

Expected behavior

The move action successful with correct conflicts resolve that doesn't lead to data loss (e.g. if trashbin is disabled).

Nextcloud Server version

30

@andrey18106 andrey18106 added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Dec 3, 2024
@solracsf solracsf added high feature: files 1. to develop Accepted and waiting to be taken care of and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Dec 3, 2024
@solracsf
Copy link
Member

solracsf commented Dec 3, 2024

Confirmed also on v29 with:

  1. Create folder /Test
  2. Create New folder inside /Test folder (so, /Test/New Folder), put some files in it
  3. Create New folder inside /Test/New folder (so, /Test/New Folder/New Folder)
  4. Move /Test/New folder/New folder to parent /Test/New folder
  5. In conflict dialog choose Select all new files
  6. See Move or copy action failed message ; the parent folder /Test/New folder gets deleted and /Test is now empty !!
  7. With the trashbin enabled, /Test/New folder ends up in the trashbin (but could be restored). Without trashbin, files would be lost.

@solracsf solracsf added this to the Nextcloud 31 milestone Dec 3, 2024
@sorbaugh
Copy link
Contributor

sorbaugh commented Dec 9, 2024

@Pytal could you take a look? 🙏

@Pytal
Copy link
Member

Pytal commented Dec 11, 2024

I've debugged the issue and found that this is not a frontend bug but rather a bug with sabre/dav. The issue can be seen in https://github.com/sabre-io/dav/blob/4.7.0/lib/DAV/CorePlugin.php#L607-L612

On MOVE “Test/Foo/Foo” to “Test/Foo” the following occurs:

  • Delete “Test/Foo”
  • Try to move “Test/Foo/Foo” to “Test/Foo”

This throws an error,

throw new \Sabre\DAV\Exception\NotFound('File with name ' . $path . ' could not be located');
, because “Test/Foo/Foo” no longer exists

cc @icewind1991 for sabre/dav expertise

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

Successfully merging a pull request may close this issue.

6 participants