Skip to content

Commit f2d01a8

Browse files
committed
fix(auto-upload): clean stale upload entities
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
1 parent 877d53f commit f2d01a8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

app/src/main/java/com/owncloud/android/ui/activity/SyncedFoldersActivity.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,13 @@ class SyncedFoldersActivity :
782782
}
783783
}
784784

785+
/**
786+
* When a synced folder is disabled or deleted, its associated OCUpload entries in the uploads
787+
* table must be cleaned up. Without this, stale upload entries outlive the folder config that
788+
* created them, causing FileUploadWorker to keep retrying uploads for a folder that no longer
789+
* exists or is intentionally turned off, and AutoUploadWorker to re-queue already handled files
790+
* on its next scan via FileSystemRepository.getFilePathsWithIds.
791+
*/
785792
private suspend fun removeEntityFromUploadEntities(id: Long) {
786793
val storageManager = fileUploadHelper.uploadsStorageManager
787794
storageManager.fileSystemDao.getBySyncedFolderId(id.toString())

0 commit comments

Comments
 (0)