Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lib/private/Files/Cache/Scanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,22 @@ public function scanFile($file, $reuseExisting = 0, $parentId = -1, $cacheData =
$data['etag'] = $etag;
}
}

// check if path / parent is inconsistent
if ($file !== $cacheData['path']) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the path variable contains the whole file path or just the directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both contain a value relative to the user's home, like "files/folderA/one"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

// fix path
\OCP\Util::writeLog(
'core',
'Repairing inconsistent file cache entry found for file id ' . $fileId . ', ' .
'path was "' . $cacheData['path'] . ' instead of "' . $file . '"',
\OCP\Util::WARN
);
$data['path'] = $file;
}

// Only update metadata that has changed
$newData = array_diff_assoc($data, $cacheData->getData());

} else {
$newData = $data;
$fileId = -1;
Expand Down