diff --git a/lib/private/Files/Cache/Wrapper/CacheJail.php b/lib/private/Files/Cache/Wrapper/CacheJail.php index 156bc3599a4d..a7c37f912acd 100644 --- a/lib/private/Files/Cache/Wrapper/CacheJail.php +++ b/lib/private/Files/Cache/Wrapper/CacheJail.php @@ -311,4 +311,8 @@ public function moveFromCache(\OCP\Files\Cache\ICache $sourceCache, $sourcePath, } return $this->cache->moveFromCache($sourceCache, $sourcePath, $this->getSourcePath($targetPath)); } + + protected function getMoveInfo($path) { + return [$this->getNumericStorageId(), $this->getSourcePath($path)]; + } } diff --git a/tests/integration/features/webdav-related-new-endpoint.feature b/tests/integration/features/webdav-related-new-endpoint.feature index d7dd4703305c..1d28fd5d991a 100644 --- a/tests/integration/features/webdav-related-new-endpoint.feature +++ b/tests/integration/features/webdav-related-new-endpoint.feature @@ -543,3 +543,24 @@ Feature: webdav-related-new-endpoint And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42" When user "user0" moves new chunk file with id "chunking-42" to "/existingFile.txt" Then User "user0" checks id of file "/existingFile.txt" + + Scenario: Checking file id after a move between received shares + Given using new dav path + And user "user0" exists + And user "user1" exists + And user "user0" created a folder "/folderA" + And user "user0" created a folder "/folderB" + And folder "/folderA" of user "user0" is shared with user "user1" + And folder "/folderB" of user "user0" is shared with user "user1" + And user "user1" created a folder "/folderA/ONE" + And User "user1" stores id of file "/folderA/ONE" + And user "user1" created a folder "/folderA/ONE/TWO" + When User "user1" moves folder "/folderA/ONE" to "/folderB/ONE" + Then as "user1" the folder "/folderA" exists + And as "user1" the folder "/folderA/ONE" does not exist + # yes, a weird bug used to make this one fail + And as "user1" the folder "/folderA/ONE/TWO" does not exist + And as "user1" the folder "/folderB/ONE" exists + And as "user1" the folder "/folderB/ONE/TWO" exists + And User "user1" checks id of file "/folderB/ONE" + diff --git a/tests/integration/features/webdav-related-old-endpoint.feature b/tests/integration/features/webdav-related-old-endpoint.feature index f7969f4884df..3bfef345ff8a 100644 --- a/tests/integration/features/webdav-related-old-endpoint.feature +++ b/tests/integration/features/webdav-related-old-endpoint.feature @@ -486,3 +486,24 @@ Feature: webdav-related-old-endpoint When As an "user0" And Downloading file "/myChunkedFile.txt" Then Downloaded content should be "AAAAABBBBBCCCCC" + + Scenario: Checking file id after a move between received shares + Given using old dav path + And user "user0" exists + And user "user1" exists + And user "user0" created a folder "/folderA" + And user "user0" created a folder "/folderB" + And folder "/folderA" of user "user0" is shared with user "user1" + And folder "/folderB" of user "user0" is shared with user "user1" + And user "user1" created a folder "/folderA/ONE" + And User "user1" stores id of file "/folderA/ONE" + And user "user1" created a folder "/folderA/ONE/TWO" + When User "user1" moves folder "/folderA/ONE" to "/folderB/ONE" + Then as "user1" the folder "/folderA" exists + And as "user1" the folder "/folderA/ONE" does not exist + # yes, a weird bug used to make this one fail + And as "user1" the folder "/folderA/ONE/TWO" does not exist + And as "user1" the folder "/folderB/ONE" exists + And as "user1" the folder "/folderB/ONE/TWO" exists + And User "user1" checks id of file "/folderB/ONE" +