Skip to content
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

Improve File Download Worker #13975

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

alperozturk96
Copy link
Collaborator

@alperozturk96 alperozturk96 commented Nov 7, 2024

  • Tests written, or not not needed

Changes

  • Convert worker to CoroutineWorker

  • Call setForeground() before starting any task

  • Remove non-translatable texts

  • Remove total and current index tracking from DownloadNotificationManager. This feature can be reintroduced after addressing this issue. Refer to the Technical Explanation section for more details; without resolving this, the download status tracking feature is ineffective and nonfunctional.

@alperozturk96 alperozturk96 changed the title improve file download worker Improve File Download Worker Nov 7, 2024
@alperozturk96 alperozturk96 force-pushed the improve-file-download-worker branch from 031a1b9 to 72f37a8 Compare December 30, 2024 08:53
@@ -25,17 +26,8 @@ class DownloadNotificationManager(
) : WorkerNotificationManager(id, context, viewThemeUtils, R.string.downloader_download_in_progress_ticker) {

@Suppress("MagicNumber")
fun prepareForStart(operation: DownloadFileOperation, currentDownloadIndex: Int, totalDownloadSize: Int) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since for each file new FileDownloadWork going to be scheduled, no need to track indexes.

@alperozturk96 alperozturk96 force-pushed the improve-file-download-worker branch 2 times, most recently from af6aa74 to 02e216d Compare January 21, 2025 08:44
@alperozturk96 alperozturk96 added this to the Nextcloud App 3.31.0 milestone Jan 21, 2025
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]>
@alperozturk96 alperozturk96 force-pushed the improve-file-download-worker branch from 5797cff to ea45d7e Compare January 21, 2025 11:14
Copy link

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/13975.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

Copy link

Codacy

Lint

TypemasterPR
Warnings5555
Errors33

SpotBugs

CategoryBaseNew
Bad practice6565
Correctness5858
Dodgy code294294
Experimental11
Internationalization77
Malicious code vulnerability11
Multithreaded correctness77
Performance5353
Security1818
Total504504

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