fix: add moveFromStorage for objectstorage to fix transfer ownership on s3#32781
fix: add moveFromStorage for objectstorage to fix transfer ownership on s3#32781unteem wants to merge 1 commit intonextcloud:masterfrom
Conversation
Signed-off-by: unteem <timothee@indie.host>
67eee25 to
5c41417
Compare
| } | ||
|
|
||
| public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) { | ||
| while ($sourceStorage->instanceOfStorage(Jail::class)) { |
There was a problem hiding this comment.
I have no idea if this is needed nor what it does.
It was in moveFromStorage function in Common.php and Local.php so I left it here
| } | ||
|
|
||
| public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) { | ||
| while ($sourceStorage->instanceOfStorage(Jail::class)) { |
Check failure
Code scanning / Psalm
UndefinedClass
| } | ||
|
|
||
| public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) { | ||
| while ($sourceStorage->instanceOfStorage(Jail::class)) { |
Check failure
Code scanning / Psalm
InvalidArgument
| /** | ||
| * @var Jail $sourceStorage | ||
| */ | ||
| $sourceInternalPath = $sourceStorage->getUnjailedPath($sourceInternalPath); |
Check failure
Code scanning / Psalm
UndefinedDocblockClass
| /** | ||
| * @var Jail $sourceStorage | ||
| */ | ||
| $sourceInternalPath = $sourceStorage->getUnjailedPath($sourceInternalPath); |
Check failure
Code scanning / Psalm
UndefinedDocblockClass
| * @var Jail $sourceStorage | ||
| */ | ||
| $sourceInternalPath = $sourceStorage->getUnjailedPath($sourceInternalPath); | ||
| $sourceStorage = $sourceStorage->getUnjailedStorage(); |
Check failure
Code scanning / Psalm
UndefinedDocblockClass
|
@icewind1991 please validate this approach |
icewind1991
left a comment
There was a problem hiding this comment.
This needs to check that the source storage is also an object store storage and uses the same underlying object store. If a file is moved from an external storage to the primary object store just moving the cache item isn't enough.
|
As there is no feedback since a while I will close this ticket. Thanks for the interest in Nextcloud and the effort put into this! 🙇 |
This PR fixes #25693 and #31870
When transferring ownership on s3 primary storage it was doing a copy and delete leading to shares being linked to non-existing files and failing to transfer
Implementing
moveFromStorageinlib/private/Files/ObjectStore/ObjectStoreStorage.phpfixes it.It doesn't fix the
isSameStorage(server/lib/private/Files/Storage/Common.php
Line 678 in e56a072
renamewhich only works for renaming a folder/files in the same user storage.