owncloud / android

:phone: The ownCloud Android App
GNU General Public License v2.0
3.77k stars 3.05k forks source link

[BUG] Invalid copy into descendant in different spaces #4293

Closed Aitorbp closed 5 months ago

Aitorbp commented 5 months ago

Actual behaviour

when you copy a folder to a space inside another folder with the same name as the folder you want to copy, the invalid copy into descendant error occurs.

Expected behaviour

It should let us copy the folder since it is not a descendant because it belongs to a different space even though the folder name is the same.

Steps to reproduce

  1. Log in to an ocis server with spaces.
  2. Create a folder called test in yourpersonal space, for example.
  3. Create another folder in another space B also called test.
  4. Go back to the personal space and try to copy the folder test into the test folder of space B.
  5. You will receive an Invalid copy into descendant error

Technical problem

Managing of the Invalid copy into a descendant error is handled in the CopyFileUseCase class in the validateOrThrowException function. But this method is not managing if the folder you are trying to copy are in the same space.