Skip to content

Commit

Permalink
Merge pull request #4294 from owncloud/fix/conflict_copy_file_without…
Browse files Browse the repository at this point in the history
…_extension

[BUG] Conflict in copy: File without extension
  • Loading branch information
Aitorbp committed Feb 5, 2024
2 parents 3ea4dda + 800d5c2 commit d6e8584
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 4 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ 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)
* 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)
Expand Down Expand Up @@ -97,6 +99,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
Expand All @@ -112,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
Expand Down
8 changes: 8 additions & 0 deletions changelog/unreleased/4294
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions changelog/unreleased/4295
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class CopyFileUseCase(
fun validateOrThrowException(listOfFilesToCopy: List<OCFile>, targetFolder: OCFile) {
require(listOfFilesToCopy.isNotEmpty())

if (listOfFilesToCopy.any { targetFolder.remotePath.startsWith(it.remotePath) }) {
if (listOfFilesToCopy.any { targetFolder.remotePath.startsWith(it.remotePath) && targetFolder.spaceId == it.spaceId }) {
throw CopyIntoDescendantException()
}
}
Expand Down

0 comments on commit d6e8584

Please sign in to comment.