Skip to content

fix(files_external): set size to -1 for root entry#60147

Open
salmart-dev wants to merge 1 commit intomasterfrom
fix/set-size-for-scanning
Open

fix(files_external): set size to -1 for root entry#60147
salmart-dev wants to merge 1 commit intomasterfrom
fix/set-size-for-scanning

Conversation

@salmart-dev
Copy link
Copy Markdown
Contributor

@salmart-dev salmart-dev commented May 4, 2026

  • Resolves: #

Summary

Sets the fake root folder's size to -1 so it gets scanned by the scanner. Before the changes below, scanning happened because there would be no cache entry for the directory, which triggered the first scan. Since with the newer changes a fake root is created with size 0, this does no longer happen.

// create a "fake" root entry so we have a fileid so we don't have to interact with the remote service
// this will be scanned on first access
$data = [
'path' => '',
'path_hash' => md5(''),
'size' => 0,
'unencrypted_size' => 0,
'mtime' => 0,
'mimetype' => ICacheEntry::DIRECTORY_MIMETYPE,
'parent' => -1,
'name' => '',
'storage_mtime' => 0,
'permissions' => 31,
'storage' => $cache->getNumericStorageId(),
'etag' => '',
'encrypted' => 0,
'checksum' => '',
];

TODO

  • [ ]

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@salmart-dev salmart-dev added this to the Nextcloud 34 milestone May 4, 2026
@salmart-dev salmart-dev self-assigned this May 4, 2026
@salmart-dev salmart-dev added bug 3. to review Waiting for reviews labels May 4, 2026
This allows the system to recogise that the mount has not been scanned
and do it when necessary.

Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
@salmart-dev salmart-dev force-pushed the fix/set-size-for-scanning branch from 1404e98 to 3b6191c Compare May 5, 2026 08:32
@salmart-dev salmart-dev marked this pull request as ready for review May 5, 2026 08:55
@salmart-dev salmart-dev requested a review from a team as a code owner May 5, 2026 08:55
@salmart-dev salmart-dev requested review from ArtificialOwl, leftybournes, nfebe and sorbaugh and removed request for a team May 5, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant