Skip to content

Conversation

@icewind1991
Copy link
Member

@icewind1991 icewind1991 commented Apr 25, 2025

An example use case would be a external storage where the root contains a very large number of sub-directories but each sub-directory is fairly small.

Currently trying to browse the root of the external storage will be slow (since the "check for update" cost scales with the number of items in directory) leading to a bad user experience. Disabling the "check for update" on the storage would make it fast but will lead to the filecache being out of date over time.

This would allow an admin to configure the instance so only the sub-directories are being checked for updates, while an external process (such as a periodic shallow-scan) can check for any changes to the root directory. Leading to an improved browsing experience for the user at the cost of a possible delay for new items in the root directory.
(Though systems like notify could be used to help there)

Currently this can only be configured by setting the mount option manually, in the future we might want to provide some curated presets in the ui.

Example for configuring it to not check the root folder as in the scenario described above:

occ files_external:option <mount id> filesystem_check_filter '/^.+$/'

@icewind1991 icewind1991 force-pushed the ext-store-check-update-filter branch from 7872b82 to 18803b3 Compare September 29, 2025 16:06
@icewind1991 icewind1991 added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Sep 29, 2025
@icewind1991 icewind1991 added this to the Nextcloud 33 milestone Sep 29, 2025
@icewind1991 icewind1991 marked this pull request as ready for review September 29, 2025 16:39
@icewind1991 icewind1991 requested a review from a team as a code owner September 29, 2025 16:39
@icewind1991 icewind1991 requested review from Altahrim, CarlSchwan and yemkareems and removed request for a team September 29, 2025 16:39
@icewind1991
Copy link
Member Author

/backport to stable32

@icewind1991
Copy link
Member Author

/backport to stable31

Copy link
Contributor

@kesselb kesselb left a comment

Choose a reason for hiding this comment

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

I had a brief look using a local external storage setup. With the example configuration, changes to the root (like creating a new folder) only appear after running files:scan for the given user. However, changes to subfolders of the root are still visible on access. So, I assume it's working as expected 👍

*
* @param ?string $filter
* @return void
* @since 32.0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @since 32.0.0
* @since 33.0.0

@kesselb
Copy link
Contributor

kesselb commented Nov 14, 2025

A small unit test would be nice though ;)

@icewind1991 icewind1991 requested review from a team and provokateurin and removed request for a team November 18, 2025 15:30
Copy link
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

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

LGTM, just needs the since version updated.

@icewind1991 icewind1991 force-pushed the ext-store-check-update-filter branch from 18803b3 to 4db0135 Compare November 20, 2025 17:55
@icewind1991
Copy link
Member Author

update @since, added tests and changed some type hints from classes to interfaces

Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991 icewind1991 force-pushed the ext-store-check-update-filter branch from 4db0135 to 816fd4b Compare November 24, 2025 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants