Skip to content

perf(file-list): db pagination - #17505

Draft
alperozturk96 wants to merge 2 commits into
masterfrom
fix/large-folder-listing
Draft

perf(file-list): db pagination#17505
alperozturk96 wants to merge 2 commits into
masterfrom
fix/large-folder-listing

Conversation

@alperozturk96

Copy link
Copy Markdown
Collaborator

Issue

When user have a lot of files and/or folder in directory app crashes. Due to fetching all files at once from DB.

{
      "header": {
        "logLevel": "ERROR",
        "pid": 7829,
        "tid": 7849,
        "applicationId": "com.nextcloud.client",
        "processName": "com.nextcloud.client",
        "tag": "CursorWindow",
        "timestamp": {
          "seconds": 1787142876,
          "nanos": 504903577
        }
      },
      "message": "Failed to read row 615, column 5 from a window with 615 rows, 52 columns"
},

Changes

  • Fetch batch by batch. Batch size is 100.
  • Return ID from DB instead of FileEntity.

How to reproduce crash?

  1. Have 2K files and 2K folders in root directory.
  2. Keep scroll
  3. Crash

@alperozturk96 alperozturk96 added this to the Nextcloud App 35.0.0 milestone Aug 19, 2026
@alperozturk96 alperozturk96 added 3. to review performance 馃殌 Performance improvement opportunities (non-crash related) labels Aug 19, 2026
@github-actions

Copy link
Copy Markdown

APK file: https://github.com/nextcloud/android/actions/runs/32258040777/artifacts/9367607142
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

daniele-verducci

This comment was marked as off-topic.

@alperozturk96 alperozturk96 mentioned this pull request Sep 1, 2026
@alperozturk96
alperozturk96 force-pushed the fix/large-folder-listing branch from c82fa9c to 9fff08d Compare September 3, 2026 08:49
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

APK file: https://github.com/nextcloud/android/actions/runs/33735450064/artifacts/9887294178
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

@alperozturk96 alperozturk96 removed this from the Nextcloud App 35.0.0 milestone Sep 7, 2026
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>

# Conflicts:
#	app/src/main/java/com/nextcloud/utils/extensions/FileDataStorageManagerExtensions.kt
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed.

suspend fun FileDataStorageManager.getSharedFileEntities(accountName: String): List<FileEntity> =
fileDao.getSharedFileIds(accountName).toEntitiesInOrderSuspended(this)

suspend fun FileDataStorageManager.getFavoriteFileEntities(accountName: String): List<FileEntity> =

@alperozturk96 alperozturk96 Sep 9, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

On master we only show 100 at root level. Is this expected @tobiasKaminsky ?

Shared tab needs to be checked as well.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also, this bug is happening both on master and of course here:

  • Log in
  • Let it load the root folder: you have x files
  • Add from another source 10k files (e.g. create them from terminal and then occ files:scan ...)
  • Pull to refresh: the same files as before are shown
  • Uninstall and reinstall the app, log in
  • All the files, including the new ones, are shown

@alperozturk96
alperozturk96 marked this pull request as draft September 9, 2026 07:57
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codacy

SpotBugs

CategoryBaseNew
Bad practice3535
Correctness5858
Dodgy code195195
Experimental11
Malicious code vulnerability22
Multithreaded correctness2626
Performance3737
Security1919
Total373373

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

Labels

2. developing performance 馃殌 Performance improvement opportunities (non-crash related)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants