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).

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>

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant