Open
Conversation
- Make FileDataStorageManager.getFolderContent() public to allow MetadataWorker access - Add recursive parameter to BackgroundJobManager.downloadFolder() with default false - Add job dependency in BackgroundJobManagerImpl to ensure MetadataWorker runs before FolderDownloadWorker - Add recursive parameter to FileDownloadHelper.downloadFolder() - Pass recursive parameter in SynchronizeFolderOperation
- Add FORCE_REFRESH flag to bypass eTag caching and always fetch fresh content - Implement BFS-based recursive folder processing to fetch metadata for ALL nested subfolders - Before: Only processed one level of subfolders (e.g., Artists but not ABBA inside it) - After: Recursively processes all nested folders at every depth level - Also fetches files at each folder level to ensure FolderDownloadWorker has access to all files
- Add warning log when no files found for recursive download - Add detailed debug logging in getAllFilesRecursive() to track folder processing - Log content count at each folder level to help diagnose issues
- Add DOWNLOAD_FOLDER_RECURSIVE action in FileAction - Add action ID in ids.xml - Add UI strings for recursive download confirmation dialogs - Add showDownloadFolderRecursiveConfirmation() in FileActivity - Add downloadFolderRecursive() method in FileOperationsHelper - Add overloaded syncFile() method with recursive parameter
- FileDetailFragment: Add handler for action_sync_file_recursive to show recursive download dialog - OCFileListFragment: Add handler for recursive download action in file list - PreviewTextFileFragment: Add confirmation dialog for folder sync
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes #269 , the inability to recursively sync folders (an issue that is 10 years old). Previously, when users tried to sync a folder with subfolders recursively, only the immediate children were synced. I spent three days of time I should have been focusing on my programming assignments on this, so please let me know if there is anything wrong with my code instead of just throwing it out. I am happy to collaborate, but I needed this feature so that I can properly sync and listen to my music.
Root Cause
The issue had three contributing factors:
Race Condition: MetadataWorker and FolderDownloadWorker were running without proper dependency, causing FolderDownloadWorker to query the database before metadata was populated.
eTag Caching: MetadataWorker was skipping folder content refresh when eTag hadn't changed, leaving the database empty.
Single-Level Processing: MetadataWorker only fetched one level of subfolders, not recursively traversing into nested folders like
Artists/ABBA, for example.Changes
🏁 Checklist