From b1bf9e8e6b90e51646963725aa0db39963968cab Mon Sep 17 00:00:00 2001 From: Aitorbp Date: Tue, 23 Jan 2024 10:09:18 +0000 Subject: [PATCH 1/7] Removed startsWith condition in CopyRemoteFileOperation.kt --- .../android/lib/resources/files/CopyRemoteFileOperation.kt | 3 --- 1 file changed, 3 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/CopyRemoteFileOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/CopyRemoteFileOperation.kt index ef653f0cb6f..a85d3a5a747 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/CopyRemoteFileOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/CopyRemoteFileOperation.kt @@ -68,9 +68,6 @@ class CopyRemoteFileOperation( // nothing to do! return RemoteOperationResult(ResultCode.OK) } - if (targetRemotePath.startsWith(sourceRemotePath) && sourceSpaceWebDavUrl == targetSpaceWebDavUrl) { - return RemoteOperationResult(ResultCode.INVALID_COPY_INTO_DESCENDANT) - } /// perform remote operation var result: RemoteOperationResult From 9bf4e1a750c31a1cca703be9f042e75b23e97417 Mon Sep 17 00:00:00 2001 From: Aitorbp Date: Wed, 24 Jan 2024 10:44:51 +0000 Subject: [PATCH 2/7] Added calens --- changelog/unreleased/4294 | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 changelog/unreleased/4294 diff --git a/changelog/unreleased/4294 b/changelog/unreleased/4294 new file mode 100644 index 00000000000..ba4d97f4375 --- /dev/null +++ b/changelog/unreleased/4294 @@ -0,0 +1,8 @@ +Bugfix: Conflict in copy with files without extension + +The check of files names that start in the same way has been removed from the copy +network operation, so that the copy use case takes care of that and works properly with +files without extension. + +https://github.com/owncloud/android/issues/4222 +https://github.com/owncloud/android/pull/4294 From e2a9ae8921205aa42ef74b36268abd22b5de58cb Mon Sep 17 00:00:00 2001 From: Aitorbp Date: Wed, 24 Jan 2024 10:45:25 +0000 Subject: [PATCH 3/7] Calens changelog updated --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cfb1a72ce7f..6475e7e28af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ ownCloud admins and users. * Bugfix - Some Null Pointer Exceptions in MainFileListViewModel: [#4065](https://github.com/owncloud/android/issues/4065) * Bugfix - Bugs related to Details view: [#4188](https://github.com/owncloud/android/issues/4188) * Bugfix - Some Null Pointer Exceptions fixed from Google Play: [#4207](https://github.com/owncloud/android/issues/4207) +* Bugfix - Conflict in copy with files without extension: [#4222](https://github.com/owncloud/android/issues/4222) * Bugfix - Add "scope" parameter to /token endpoint HTTP requests: [#4260](https://github.com/owncloud/android/pull/4260) * Bugfix - Fix in the handling of the base URL: [#4279](https://github.com/owncloud/android/issues/4279) * Change - Android library as a module instead of submodule: [#3962](https://github.com/owncloud/android/issues/3962) @@ -97,6 +98,15 @@ ownCloud admins and users. https://github.com/owncloud/android/issues/4207 https://github.com/owncloud/android/pull/4238 +* Bugfix - Conflict in copy with files without extension: [#4222](https://github.com/owncloud/android/issues/4222) + + The check of files names that start in the same way has been removed from the + copy network operation, so that the copy use case takes care of that and works + properly with files without extension. + + https://github.com/owncloud/android/issues/4222 + https://github.com/owncloud/android/pull/4294 + * Bugfix - Add "scope" parameter to /token endpoint HTTP requests: [#4260](https://github.com/owncloud/android/pull/4260) The "scope" parameter is now always sent in the body of HTTP requests to the From d81bd4f1e046eb1ebb899637135f9280be873fa6 Mon Sep 17 00:00:00 2001 From: Aitorbp Date: Wed, 24 Jan 2024 11:06:42 +0000 Subject: [PATCH 4/7] Added condition space in CopyFileUseCase --- .../owncloud/android/domain/files/usecases/CopyFileUseCase.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/owncloudDomain/src/main/java/com/owncloud/android/domain/files/usecases/CopyFileUseCase.kt b/owncloudDomain/src/main/java/com/owncloud/android/domain/files/usecases/CopyFileUseCase.kt index ceaf2a5a97e..94cf53c1261 100644 --- a/owncloudDomain/src/main/java/com/owncloud/android/domain/files/usecases/CopyFileUseCase.kt +++ b/owncloudDomain/src/main/java/com/owncloud/android/domain/files/usecases/CopyFileUseCase.kt @@ -49,7 +49,7 @@ class CopyFileUseCase( fun validateOrThrowException(listOfFilesToCopy: List, targetFolder: OCFile) { require(listOfFilesToCopy.isNotEmpty()) - if (listOfFilesToCopy.any { targetFolder.remotePath.startsWith(it.remotePath) }) { + if (listOfFilesToCopy.any { targetFolder.remotePath.startsWith(it.remotePath) and (targetFolder.spaceId == it.spaceId) }) { throw CopyIntoDescendantException() } } From 99092fb2e745644838990316401f8e660875d17f Mon Sep 17 00:00:00 2001 From: Aitorbp Date: Thu, 25 Jan 2024 11:02:01 +0000 Subject: [PATCH 5/7] Fix from cr --- .../owncloud/android/domain/files/usecases/CopyFileUseCase.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/owncloudDomain/src/main/java/com/owncloud/android/domain/files/usecases/CopyFileUseCase.kt b/owncloudDomain/src/main/java/com/owncloud/android/domain/files/usecases/CopyFileUseCase.kt index 94cf53c1261..db69cf74eac 100644 --- a/owncloudDomain/src/main/java/com/owncloud/android/domain/files/usecases/CopyFileUseCase.kt +++ b/owncloudDomain/src/main/java/com/owncloud/android/domain/files/usecases/CopyFileUseCase.kt @@ -49,7 +49,7 @@ class CopyFileUseCase( fun validateOrThrowException(listOfFilesToCopy: List, targetFolder: OCFile) { require(listOfFilesToCopy.isNotEmpty()) - if (listOfFilesToCopy.any { targetFolder.remotePath.startsWith(it.remotePath) and (targetFolder.spaceId == it.spaceId) }) { + if (listOfFilesToCopy.any { targetFolder.remotePath.startsWith(it.remotePath) && targetFolder.spaceId == it.spaceId }) { throw CopyIntoDescendantException() } } From 444d121087a04005d9c6791cabc8f182d3068a9f Mon Sep 17 00:00:00 2001 From: Aitorbp Date: Thu, 25 Jan 2024 11:15:21 +0000 Subject: [PATCH 6/7] added calens --- changelog/unreleased/4295 | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 changelog/unreleased/4295 diff --git a/changelog/unreleased/4295 b/changelog/unreleased/4295 new file mode 100644 index 00000000000..faa1db7e745 --- /dev/null +++ b/changelog/unreleased/4295 @@ -0,0 +1,6 @@ +Bugfix: Copy folder into descendant in different spaces + +Copying a folder into another folder with the same name in a different space now works correctly. + +https://github.com/owncloud/android/issues/4293 +https://github.com/owncloud/android/pull/4295 From 8a05127f88f4e7b4e6dda3bd5c78529cd44b4142 Mon Sep 17 00:00:00 2001 From: Aitorbp Date: Thu, 25 Jan 2024 11:24:38 +0000 Subject: [PATCH 7/7] Calens changelog updated --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6475e7e28af..f303b998955 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ ownCloud admins and users. * Bugfix - Conflict in copy with files without extension: [#4222](https://github.com/owncloud/android/issues/4222) * Bugfix - Add "scope" parameter to /token endpoint HTTP requests: [#4260](https://github.com/owncloud/android/pull/4260) * Bugfix - Fix in the handling of the base URL: [#4279](https://github.com/owncloud/android/issues/4279) +* Bugfix - Copy folder into descendant in different spaces: [#4293](https://github.com/owncloud/android/issues/4293) * Change - Android library as a module instead of submodule: [#3962](https://github.com/owncloud/android/issues/3962) * Enhancement - Koin DSL: [#3966](https://github.com/owncloud/android/pull/3966) * Enhancement - Unit tests for datasources classes - Part 1 & Fixes: [#4063](https://github.com/owncloud/android/issues/4063) @@ -122,6 +123,14 @@ ownCloud admins and users. https://github.com/owncloud/android/issues/4279 https://github.com/owncloud/android/pull/4287 +* Bugfix - Copy folder into descendant in different spaces: [#4293](https://github.com/owncloud/android/issues/4293) + + Copying a folder into another folder with the same name in a different space now + works correctly. + + https://github.com/owncloud/android/issues/4293 + https://github.com/owncloud/android/pull/4295 + * Change - Android library as a module instead of submodule: [#3962](https://github.com/owncloud/android/issues/3962) Android library, containing all networking stuff, is now the 5th module in the