Skip to content

Conversation

@alperozturk96
Copy link
Collaborator

@alperozturk96 alperozturk96 commented Oct 28, 2025

  • Tests written, or not not needed

Issue

After a failed auto-upload or manual upload, some entities remain marked as failed. As a result, the same uploads are triggered again (due to SYNC_CONFLICT, wrongly chosen failed upload IDs for upload) on every app launch or pull-to-refresh from various screens.

Changes

Checks for the existence of the file at the remote path and removes the corresponding upload entity if the file already exists

Fixes DB update

Chooses failed uploads correctly

@alperozturk96 alperozturk96 changed the title fix: failed upload retry prevent re-upload of files already present on remote Oct 28, 2025
@alperozturk96 alperozturk96 mentioned this pull request Oct 28, 2025
4 tasks
@alperozturk96 alperozturk96 changed the title prevent re-upload of files already present on remote fix: failed upload retry Oct 28, 2025

val fileEntity =
fileDataStorageManager.fileDao.getFileByDecryptedRemotePath(remotePath, user.accountName)
if (fileEntity != null) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Check existence file on remote

continue
}

uploads.add(failedUpload.uploadId)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Only add checked failed uploads.

val remotePath = upload.remotePath ?: continue
val fileExists =
fileStorageManager.fileDao.getFileByDecryptedRemotePath(remotePath, accountName) != null
if (fileExists) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Check existence file on remote

@tobiasKaminsky
Copy link
Member

image

For sync conflict the settings must be obeyed.

Copy link
Member

@tobiasKaminsky tobiasKaminsky left a comment

Choose a reason for hiding this comment

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

Please obey settings for sync conflict.

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 fix/failed-upload-retry branch from 516fc83 to e22ee13 Compare October 29, 2025 14:03
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
@github-actions
Copy link

blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed.

@github-actions
Copy link

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

@github-actions
Copy link

Codacy

Lint

TypemasterPR
Warnings4141
Errors1111

SpotBugs

CategoryBaseNew
Bad practice4242
Correctness7373
Dodgy code266266
Experimental11
Internationalization77
Malicious code vulnerability22
Multithreaded correctness3535
Performance4848
Security1818
Total492492

@alperozturk96 alperozturk96 marked this pull request as draft October 30, 2025 07:38
@alperozturk96
Copy link
Collaborator Author

Better to split this PR so that we can proceed faster and easy to review.

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.

3 participants