Skip to content

Commit cfa95ec

Browse files
grnd-altbackportbot[bot]
authored andcommitted
feat: improve occ file:transfer-ownership logging
Signed-off-by: grnd-alt <github@belakkaf.net>
1 parent 6f2af51 commit cfa95ec

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

apps/files/lib/Service/OwnershipTransferService.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ public function transfer(
167167
$sourcePath
168168
);
169169

170+
$sourceSize = $view->getFileInfo($sourcePath)->getSize();
171+
170172
// transfer the files
171173
$this->transferFiles(
172174
$sourceUid,
@@ -175,6 +177,7 @@ public function transfer(
175177
$view,
176178
$output
177179
);
180+
$sizeDifference = $sourceSize - $view->getFileInfo($finalTarget)->getSize();
178181

179182
// transfer the incoming shares
180183
if ($transferIncomingShares === true) {
@@ -210,6 +213,9 @@ public function transfer(
210213
$shares,
211214
$output
212215
);
216+
if ($sizeDifference !== 0) {
217+
$output->writeln("Transferred folder have a size difference of: $sizeDifference Bytes which means the transfer may be incomplete. Please check the logs if there was any issue during the transfer operation.");
218+
}
213219
}
214220

215221
private function walkFiles(View $view, $path, Closure $callBack) {

0 commit comments

Comments
 (0)