Skip to content

Conversation

alperozturk96
Copy link
Collaborator

@alperozturk96 alperozturk96 commented Sep 9, 2025

  • Tests written, or not not needed

Issue

Previously, FilesSyncWork used the REPLACE work policy, which would cancel any unfinished work whenever a new worker was enqueued. In scenarios such as users taking multiple photos quickly in the DCIM folder, this could lead to:

  1. Ongoing uploads being killed prematurely.
  2. updateFilesystemFileAsSentForUpload not being called, causing files to be re-uploaded unnecessarily.
  3. Execution order issues, since files were first dispatched to FileUploadWorker and only later marked as uploaded.

Changes

Synchronous upload flow:

Removed the dependency on FileUploadWorker. FilesSyncWork now directly uses UploadFileOperation per file.
Each file is marked as “sent for upload” before uploading, ensuring correct DB state and sequential execution.

Foreground service for long-running jobs:

ForegroundInfo is now set for FilesSyncWork with ForegroundServiceType.DataSync.
Ensures Android treats this as a long-running background task.

@tobiasKaminsky Do we need to show notification for auto upload? Since auto upload continuous process and showing notification for each upload can be too much?

Signed-off-by: alperozturk <[email protected]>
@alperozturk96 alperozturk96 added the performance 🚀 Performance improvement opportunities (non-crash related) label Sep 9, 2025
Copy link

github-actions bot commented Sep 9, 2025

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/15586.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance 🚀 Performance improvement opportunities (non-crash related)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant