Skip to content

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

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

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

Conversation

@salmart-dev

@salmart-devsalmart-dev commented May 4, 2026

Copy link
Copy Markdown
Contributor
  • 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-devsalmart-dev added this to the Nextcloud 34 milestone May 4, 2026
@salmart-devsalmart-dev self-assigned this May 4, 2026
@salmart-devsalmart-dev added bug 3. to review Waiting for reviews labels May 4, 2026
@salmart-dev
salmart-devforce-pushed the fix/set-size-for-scanning branch from 1404e98 to 3b6191cCompareMay 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 ownerMay 5, 2026 08:55
@salmart-dev
salmart-dev requested review from ArtificialOwl, leftybournes, nfebe and sorbaugh and removed request for a teamMay 5, 2026 08:55
@nextcloud-botnextcloud-bot mentioned this pull request May 27, 2026
@nextcloud-botnextcloud-bot mentioned this pull request Jun 4, 2026
This was referenced Jun 5, 2026
@susnuxsusnux added the community pull requests from community label Jun 9, 2026
@come-nccome-nc removed the community pull requests from community label Jun 11, 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-devforce-pushed the fix/set-size-for-scanning branch from 3b6191c to 66fde3fCompareJuly 3, 2026 10:16
@salmart-dev

Copy link
Copy Markdown
ContributorAuthor

/backport to stable34

@salmart-dev

Copy link
Copy Markdown
ContributorAuthor

/backport to stable33

@salmart-dev

Copy link
Copy Markdown
ContributorAuthor

/backport to stable32

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@salmart-dev@icewind1991@susnux@nextcloud-bot@come-nc