-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Sync Worker #14166
base: master
Are you sure you want to change the base?
Add Sync Worker #14166
Conversation
8da1e10
to
d017482
Compare
57990c8
to
0c5db2c
Compare
|
||
private fun getFiles(folder: OCFile, storageManager: FileDataStorageManager): List<OCFile> = | ||
storageManager.getAllFilesRecursivelyInsideFolder(folder) | ||
.filter { !it.isFolder && !it.isDown } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same logic we have in the SynchronizeFolderOperation.prepareOpsFromLocalKnowledge()
@@ -500,7 +499,7 @@ private void startDirectDownloads() { | |||
Log_OC.d(TAG, "Exception caught at startDirectDownloads" + e); | |||
} | |||
} else { | |||
mFilesForDirectDownload.forEach(file -> fileDownloadHelper.downloadFile(user, file)); | |||
fileDownloadHelper.syncFolder(mLocalFolder); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since SyncWorker is responsible for preparing the files, there is no need to pass an array of files to the worker. Additionally, in scenarios where a user attempts to sync a large number of files (e.g., 1,000 files), the app could freeze or crash due to limitations associated with passing a large amount of data between classes via inputData.
4da8950
to
41d9f2e
Compare
41d9f2e
to
5f8baf6
Compare
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
5f8baf6
to
5422ca6
Compare
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/14166.apk |
Changes:
• Fixed the issue of scheduling too many FileDownloadWorker instances for folder sync.
• Resolved the issue of retrieving sub-folder items for the selected folder.
• Improved file download status observation, including states like syncing, downloading, and downloaded.
• Better constraints for worker
• Enhanced folder sync progress observation in notifications.
• Optimized performance using CoroutineWorker.
Demo
swd.mp4
big_file_test.mp4
Known Issues
• The current codebase does not efficiently handle the observation of the download states such as downloading, downloaded, cancelled. The swapDirectory() method must be called to display the green tick icon after each download, which is not an ideal approach. Additionally, invoking notifyItemChanged() does not impact the return value of the isDown() function, resulting in the downloaded file not being recognized as such. Thus, green tick cannot be set after file download completion.
A more robust solution could be considered; please feel free to suggest any viable alternatives.