Skip to content

fix(sync): synchronize deeply nested files without flooding the download queue - #17792

Open
oskarsss wants to merge 1 commit into
nextcloud:masterfrom
oskarsss:fix/recursive-folder-sync
Open

oskarsss wants to merge 1 commit into
nextcloud:masterfrom
oskarsss:fix/recursive-folder-sync

Conversation

@oskarsss

@oskarsss oskarsss commented Oct 8, 2026

Copy link
Copy Markdown

Problem

Enabling sync on a folder could leave deeply nested files undownloaded. An unchanged parent folder ETag could prevent traversal into its descendants.

Changes

  • Traverse cached descendants even when the parent folder ETag is unchanged.
  • Save newly discovered folders before visiting their children.
  • Download missing files sequentially during ongoing two-way sync, avoiding a burst of queued download operations.
  • Preserve the separate manual Sync and Sync all behavior.
  • Check cancellation and sync constraints between files.
  • Report transfer failures in the folder sync result.

Testing

  • 34 selected tests passed on the master-based branch.
  • 23 regression tests passed for the stable test APK.
  • Updating the emulator to test.3 preserved login, permissions, and existing downloads.

An earlier test.2 device run downloaded 1,213 additional files totaling 6.50 GB in approximately 44 minutes. All newly downloaded file sizes matched the server, and three sampled deep files also matched server SHA-256 hashes.

These measurements demonstrate recursive download completion; they are not a controlled speed comparison with the original app.

Test APK

https://github.com/oskarsss/android/releases/tag/stable-35.0.1-recursive-sync-test.3

Known limitations

Manual Sync and Sync all transfers, encrypted folders, and upload/conflict behavior have not been verified in the latest device run.

Stable QA lint reports an existing ObsoleteSdkInt error in unchanged QA icon resources.

AI assistance

Implementation, cleanup, and automated testing were assisted by Codex (GPT-6.1-Sol).

@oskarsss
oskarsss force-pushed the fix/recursive-folder-sync branch from bd45049 to 5bbf83a Compare October 15, 2026 04:53
@github-actions

Copy link
Copy Markdown

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Visit cached descendants even when their parent ETag is unchanged and
persist newly discovered folders before visiting their children. Process
missing files sequentially within the foreground two-way sync worker.

Keep manual service dispatch, propagate transfer errors to the root,
check ongoing constraints between files, and save completion status using
fresh folder metadata. Cover traversal, cancellation, error handling,
operation reuse, and worker completion with unit tests.

Assisted-by: Codex:gpt-6.1-sol
Signed-off-by: Oskars Pucka <89988568+oskarsss@users.noreply.github.com>
@oskarsss
oskarsss force-pushed the fix/recursive-folder-sync branch from 5bbf83a to ad3ef31 Compare October 27, 2026 10:28

This branch has not been deployed

No deployments
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.

1 participant