Skip to content

Commit ba20b9e

Browse files
authored
Merge pull request #4341 from owncloud/fix/retried_successful_uploads_dont_free_space_tmp_folder
[BUG] Retried successful uploads don't free space in /tmp folder
2 parents a8334fd + a328fd2 commit ba20b9e

6 files changed

Lines changed: 37 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ ownCloud admins and users.
3030
## Summary
3131

3232
* Bugfix - Remove lens icon in folder picker: [#4311](https://github.com/owncloud/android/issues/4311)
33+
* Bugfix - Retried successful uploads are cleaned up from the temporary folder: [#4335](https://github.com/owncloud/android/issues/4335)
3334
* Change - Upgrade minimum SDK version to Android 7.0 (v24): [#4230](https://github.com/owncloud/android/issues/4230)
3435
* Change - Automatic discovery of the account in login: [#4301](https://github.com/owncloud/android/issues/4301)
3536
* Change - Add new prefixes in commit messages of 3rd party contributors: [#4346](https://github.com/owncloud/android/pull/4346)
37+
* Enhancement - Correct "Local only" option in remove dialog: [#3936](https://github.com/owncloud/android/issues/3936)
3638
* Enhancement - Improvements in Manage Accounts view: [#4148](https://github.com/owncloud/android/issues/4148)
3739
* Enhancement - New setting for automatic removal of local files: [#4175](https://github.com/owncloud/android/issues/4175)
3840
* Enhancement - Unit tests for repository classes - Part 1: [#4232](https://github.com/owncloud/android/issues/4232)
@@ -48,6 +50,14 @@ ownCloud admins and users.
4850
https://github.com/owncloud/android/issues/4311
4951
https://github.com/owncloud/android/pull/4339
5052

53+
* Bugfix - Retried successful uploads are cleaned up from the temporary folder: [#4335](https://github.com/owncloud/android/issues/4335)
54+
55+
Temporary files related to a failed upload are deleted after retrying it and
56+
being successfully completed.
57+
58+
https://github.com/owncloud/android/issues/4335
59+
https://github.com/owncloud/android/pull/4341
60+
5161
* Change - Upgrade minimum SDK version to Android 7.0 (v24): [#4230](https://github.com/owncloud/android/issues/4230)
5262

5363
The minimum Android version will be Android 7.0 Nougat (API 24). The application
@@ -71,6 +81,14 @@ ownCloud admins and users.
7181

7282
https://github.com/owncloud/android/pull/4346
7383

84+
* Enhancement - Correct "Local only" option in remove dialog: [#3936](https://github.com/owncloud/android/issues/3936)
85+
86+
"Local only" option in remove dialog will only be shown if checking selected
87+
files and folders recursively, at least one file is available locally.
88+
89+
https://github.com/owncloud/android/issues/3936
90+
https://github.com/owncloud/android/pull/4289
91+
7492
* Enhancement - Improvements in Manage Accounts view: [#4148](https://github.com/owncloud/android/issues/4148)
7593

7694
Removed the key icon and avoid overlap account name with icons in Manage

changelog/unreleased/4341

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Bugfix: Retried successful uploads are cleaned up from the temporary folder
2+
3+
Temporary files related to a failed upload are deleted after retrying it and being successfully completed.
4+
5+
https://github.com/owncloud/android/issues/4335
6+
https://github.com/owncloud/android/pull/4341

owncloudApp/src/main/java/com/owncloud/android/presentation/releasenotes/ReleaseNotesViewModel.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,12 @@ class ReleaseNotesViewModel(
7979
title = R.string.release_notes_4_3_0_title_7,
8080
subtitle = R.string.release_notes_4_3_0_subtitle_7,
8181
type = ReleaseNoteType.ENHANCEMENT
82-
)
82+
),
83+
ReleaseNote(
84+
title = R.string.release_notes_4_3_0_title_retried_successful_uploads_delete_temporary_folder,
85+
subtitle = R.string.release_notes_4_3_0_subtitle_retried_successful_uploads_delete_temporary_folder,
86+
type = ReleaseNoteType.BUGFIX,
87+
),
8388
)
8489
}
8590
}

owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/RetryUploadFromSystemUseCase.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
*
44
* @author Abel García de Prada
55
* @author Juan Carlos Garrote Gascón
6+
* @author Aitor Ballesteros Pavón
67
*
7-
* Copyright (C) 2021 ownCloud GmbH.
8+
* Copyright (C) 2024 ownCloud GmbH.
89
* <p>
910
* This program is free software: you can redistribute it and/or modify
1011
* it under the terms of the GNU General Public License version 2,
@@ -24,6 +25,7 @@ package com.owncloud.android.usecases.transfers.uploads
2425
import androidx.work.WorkInfo
2526
import androidx.work.WorkManager
2627
import com.owncloud.android.domain.BaseUseCase
28+
import com.owncloud.android.domain.camerauploads.model.UploadBehavior
2729
import com.owncloud.android.domain.transfers.TransferRepository
2830
import com.owncloud.android.extensions.getWorkInfoByTags
2931
import com.owncloud.android.workers.UploadFileFromFileSystemWorker
@@ -56,7 +58,7 @@ class RetryUploadFromSystemUseCase(
5658
accountName = uploadToRetry.accountName,
5759
localPath = uploadToRetry.localPath,
5860
lastModifiedInSeconds = (uploadToRetry.transferEndTimestamp?.div(1000)).toString(),
59-
behavior = uploadToRetry.localBehaviour.name,
61+
behavior = UploadBehavior.MOVE.name,
6062
uploadPath = uploadToRetry.remotePath,
6163
uploadIdInStorageManager = params.uploadIdInStorageManager
6264
)

owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFilesFromContentUriUseCase.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class UploadFilesFromContentUriUseCase(
8282
accountName = accountName,
8383
fileSize = documentFile.length(),
8484
status = TransferStatus.TRANSFER_QUEUED,
85-
localBehaviour = UploadBehavior.COPY,
85+
localBehaviour = UploadBehavior.MOVE,
8686
forceOverwrite = false,
8787
createdBy = UploadEnqueuedBy.ENQUEUED_BY_USER,
8888
spaceId = spaceId,

owncloudApp/src/main/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@
741741
<string name="release_notes_4_3_0_subtitle_6">Added a warning dialog in the login view when it is a http connection</string>
742742
<string name="release_notes_4_3_0_title_7">Correct \"Local only\" option in remove dialog</string>
743743
<string name="release_notes_4_3_0_subtitle_7">\"Local only\" option in remove dialog will only be shown if checking selected files and folders recursively, at least one file is available locally</string>
744+
<string name="release_notes_4_3_0_title_retried_successful_uploads_delete_temporary_folder">Retried successful uploads are cleaned up from the temporary folder</string>
745+
<string name="release_notes_4_3_0_subtitle_retried_successful_uploads_delete_temporary_folder">Temporary files related to an upload are deleted after the retried successful uploads is finished</string>
744746

745747
<!-- Open in web -->
746748
<string name="ic_action_open_in_web">Open in web</string>

0 commit comments

Comments
 (0)