Skip to content

Commit bfbc787

Browse files
committed
chore: WIP - debug for CI
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 parent 14b8770 commit bfbc787

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

apps/files_versions/tests/VersioningTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,10 @@ public function testMoveFileIntoSharedFolderAsRecipient(): void {
427427
// move file into the shared folder as recipient
428428
$success = Filesystem::rename('/test.txt', '/folder1/test.txt');
429429

430-
$this->assertTrue($success);
430+
// TODO: Voir is $v2 existe pour voir si c’est la copie ou la suppression qui foire
431+
// Mettre du debug dans Wrapper/Encrytion::copyBetweenStorage c’est le suspect n-1
432+
var_dump(['success' => $success, 'v1 exists' => $this->rootView->file_exists($v1), 'v2 exists' => $this->rootView->file_exists($v2)]);
433+
$this->assertTrue($success); // renvoi true :-O
431434
$this->assertFalse($this->rootView->file_exists($v1));
432435
$this->assertFalse($this->rootView->file_exists($v2));
433436

lib/private/Files/Storage/Wrapper/Encryption.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,20 +522,25 @@ public function moveFromStorage(
522522
// - remove $this->copyBetweenStorage
523523

524524
if (!$sourceStorage->isDeletable($sourceInternalPath)) {
525+
echo "[DEBUG] $sourceInternalPath $targetInternalPath not deletable " . __FILE__ . ':' . __LINE__ . "\n";
525526
return false;
526527
}
527528

528529
$result = $this->copyBetweenStorage($sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime, true);
530+
echo "[DEBUG] $sourceInternalPath $targetInternalPath copy:$result " . __FILE__ . ':' . __LINE__ . "\n";
529531
if ($result) {
532+
echo "[DEBUG] $sourceInternalPath $targetInternalPath copy success " . __FILE__ . ':' . __LINE__ . "\n";
530533
if ($sourceStorage->instanceOfStorage(ObjectStoreStorage::class)) {
531534
/** @var ObjectStoreStorage $sourceStorage */
532535
$sourceStorage->setPreserveCacheOnDelete(true);
533536
}
534537
try {
535538
if ($sourceStorage->is_dir($sourceInternalPath)) {
536539
$result = $sourceStorage->rmdir($sourceInternalPath);
540+
echo "[DEBUG] $sourceInternalPath rmdir:$result " . __FILE__ . ':' . __LINE__ . "\n";
537541
} else {
538542
$result = $sourceStorage->unlink($sourceInternalPath);
543+
echo "[DEBUG] $sourceInternalPath unlink:$result " . __FILE__ . ':' . __LINE__ . "\n";
539544
}
540545
} finally {
541546
if ($sourceStorage->instanceOfStorage(ObjectStoreStorage::class)) {
@@ -621,10 +626,12 @@ private function copyBetweenStorage(
621626
bool $preserveMtime,
622627
bool $isRename,
623628
): bool {
629+
echo "[DEBUG] $sourceInternalPath $targetInternalPath $isRename " . __FILE__ . ':' . __LINE__ . "\n";
624630
// for versions we have nothing to do, because versions should always use the
625631
// key from the original file. Just create a 1:1 copy and done
626632
if ($this->isVersion($targetInternalPath) ||
627633
$this->isVersion($sourceInternalPath)) {
634+
echo "[DEBUG] $sourceInternalPath $targetInternalPath $isRename " . __FILE__ . ':' . __LINE__ . "\n";
628635
// remember that we try to create a version so that we can detect it during
629636
// fopen($sourceInternalPath) and by-pass the encryption in order to
630637
// create a 1:1 copy of the file
@@ -642,6 +649,7 @@ private function copyBetweenStorage(
642649
}
643650
$this->updateEncryptedVersion($sourceStorage, $sourceInternalPath, $targetInternalPath, $isRename, true);
644651
}
652+
echo "[DEBUG] $result " . __FILE__ . ':' . __LINE__ . "\n";
645653
return $result;
646654
}
647655

0 commit comments

Comments
 (0)