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.
Issue
Previously,
FilesSyncWork
used theREPLACE
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:updateFilesystemFileAsSentForUpload
not being called, causing files to be re-uploaded unnecessarily.FileUploadWorker
and only later marked as uploaded.Changes
Synchronous upload flow:
Removed the dependency on
FileUploadWorker
.FilesSyncWork
now directly usesUploadFileOperation
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 forFilesSyncWork
withForegroundServiceType.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?