Skip to content

[FIX] Removed files in failed uploads - #4657

Merged
joragua merged 4 commits into
masterfrom
fix/removed_files_in_failed_uploads
Aug 11, 2025
Merged

joragua merged 4 commits into
masterfrom
fix/removed_files_in_failed_uploads

Conversation

@joragua

@joragua joragua commented Aug 4, 2025 •

Copy link
Copy Markdown
Member

Related Issues

App: #4653

  • Add changelog files for the fixed issues in folder changelog/unreleased. More info here
  • Add feature to Release Notes in ReleaseNotesViewModel.kt creating a new ReleaseNote() with String resources (if required)

QA

@joragua joragua self-assigned this Aug 4, 2025
@joragua joragua linked an issue Aug 4, 2025 that may be closed by this pull request
@joragua
joragua force-pushed the fix/removed_files_in_failed_uploads branch from f2115d1 to 80e02e5 Compare August 5, 2025 09:40
@joragua
joragua force-pushed the fix/removed_files_in_failed_uploads branch from bed785f to 76c98ef Compare August 5, 2025 09:49
@joragua
joragua marked this pull request as ready for review August 5, 2025 10:08
@joragua
joragua requested a review from jesmrec August 5, 2025 10:08
@jesmrec

jesmrec commented Aug 8, 2025

Copy link
Copy Markdown
Member

LGTM 👍

@jesmrec

jesmrec commented Aug 8, 2025 •

Copy link
Copy Markdown
Member

Filling up the use cases chart:

Uploads

Manual retry

Server down, credentials revoked

Scenario Outcome Local source /tmp oC10 oCIS Comment
Manual 1st att ✅ Keep file clean ✅ ✅
Manual 1st att ❌ Keep file file ✅ ✅
Manual 2nd att ✅ Keep file clean ✅ ✅
Photo 1st att ✅ Remove file clean ✅ ✅
Photo 1st att ❌ Keep file file ✅ ✅ sdcard > Android > data > com.owncloud.android > cache
Photo 2nd att ✅ Remove file clean ✅ ✅ sdcard > Android > data > com.owncloud.android > cache
Shortcut 1st att ✅ Remove file clean ✅ ✅
Shortcut 1st att ❌ Keep file file ✅ ✅ sdcard > Android > data > com.owncloud.android > cache
Shortcut 2nd att ✅ Remove file clean ✅ ✅ sdcard > Android > data > com.owncloud.android > cache
Auto Keep 1st att ✅ Keep file clean ✅ ✅
Auto Keep 1st att ❌ Keep file file ✅ ✅
Auto Keep 2nd att ✅ Keep file clean ✅ ✅
Auto Rem. 1st att ✅ Remove file clean ✅ ✅
Auto Rem. 1st att ❌ Keep file file ✅ ✅
Auto Rem. 2nd att ✅ Remove file clean ✅ ✅
External 1st att ✅ Keep file clean ✅ ✅
External 1st att ❌ Keep file file ✅ ✅
External 2nd att ✅ Keep file clean ✅ ✅

Automatic retry

Connectivity loss

Scenario Outcome Local source /tmp oC10 oCIS Comment
Manual 1st att ❌ Keep file file ✅ ✅ No pic in /tmp because ENQUEUED status
Manual 2nd att ✅ Keep file clean ✅ ✅
Photo 1st att ❌ Keep file file ✅ ✅ sdcard > Android > data > com.owncloud.android > cache
Photo 2nd att ✅ Remove file clean ✅ ✅ sdcard > Android > data > com.owncloud.android > cache
Shortcut 1st att ❌ Keep file file ✅ ✅ sdcard > Android > data > com.owncloud.android > cache
Shortcut 2nd att ✅ Remove file clean ✅ ✅ sdcard > Android > data > com.owncloud.android > cache
Auto Keep 1st att ❌ Keep file file ✅ ✅ No pic in /tmp because ENQUEUED status
Auto Keep 2nd att ✅ Keep file clean ✅ ✅
Auto Rem. 1st att ❌ Keep file file ✅ ✅ No pic in /tmp because ENQUEUED status
Auto Rem. 2nd att ✅ Remove file clean ✅ ✅
External 1st att ❌ Keep file file ✅ ✅
External 2nd att ✅ Keep file clean ✅ ✅

Corner cases:

  • Manual upload + manual retry + automatic retry + success ✅
  • Manual upload + automatic retry + manual retry + success ✅
  • Auto upload + manual retry + automatic retry + success ✅
  • Auto upload + automatic retry + manual retry + success ✅
  • Photo upload + manual retry + automatic retry + success ✅
  • Photo upload + automatic retry + manual retry + success ✅

@jesmrec

jesmrec commented Aug 11, 2025

Copy link
Copy Markdown
Member

This is approved on my side 👍

Just one detail to take in account: when lack of connectivity, uploads are enqueued (not failed). Under such status, manual and automatic uploads don't copy the files to upload to /tmp folder, but the uploads from external app. The final status of the upload after retries and success is always correct.

Will update the test plan with that.

@joragua

joragua commented Aug 11, 2025

Copy link
Copy Markdown
Member Author

For manual and automatic uploads, files are copied to /tmp folder once the network connection is restored and the worker (UploadFilesFromContentUriWorker) executes its doWork() method.

For uploads from external apps, the files are copied to /tmp folder before triggering the use case (UploadFileFromSystemUseCase). This is because this use case only supports string URLs (not content uris) Therefore a temporary file must be created before executing it.

@joragua
joragua merged commit 9bb77d3 into master Aug 11, 2025
@joragua
joragua deleted the fix/removed_files_in_failed_uploads branch August 11, 2025 13:11
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.

[BUG] Removed files in failed uploads

3 participants