Skip to content

Fix slow file list loading when entering a directory for the first time with 1000+ files.#17104

Open
berlin2123 wants to merge 2 commits into
nextcloud:masterfrom
berlin2123:patch-1
Open

Fix slow file list loading when entering a directory for the first time with 1000+ files.#17104
berlin2123 wants to merge 2 commits into
nextcloud:masterfrom
berlin2123:patch-1

Conversation

@berlin2123
Copy link
Copy Markdown

Summary

When syncing a folder with many files for the first time, each remote file triggered a ContentProvider getFileByPath() query. For a directory with 1000+ files, this meant 1000+ individual database lookups — all of which returned null because the files did not exist locally yet.

Skip the per-file fallback when localFilesMap is empty, since no local state exists to merge.

🏁 Checklist

  • Tests written, or not not needed

When syncing a folder with many files for the first time, each remote file triggered a ContentProvider getFileByPath() query. For a directory with 1000+ files, this meant 1000+ individual database lookups — all of which returned null because the files did not exist locally yet.

Skip the per-file fallback when localFilesMap is empty, since no local state exists to merge.

Signed-off-by: berlin2123 <68841407+berlin2123@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant