-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sure upload is only added once to db #12345
Make sure upload is only added once to db #12345
Conversation
1df7c7d
to
f68aed8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During my brief tests, this change worked well.
app/src/main/java/com/owncloud/android/datamodel/UploadsStorageManager.java
Outdated
Show resolved
Hide resolved
1f3ac33
to
3024763
Compare
Signed-off-by: Jonas Mayer <[email protected]>
Signed-off-by: Jonas Mayer <[email protected]>
Signed-off-by: Jonas Mayer <[email protected]>
Signed-off-by: Jonas Mayer <[email protected]>
Signed-off-by: Jonas Mayer <[email protected]>
Signed-off-by: Jonas Mayer <[email protected]>
3024763
to
3d3cd15
Compare
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/12345.apk |
Thank you 100 times! It is nice to provide something to fix this. But I am not sure about what you mean with 'if an upload failed' and the consequences of 'with "in progress" to try to upload it again'. Instead of that, the existing file and the file to be uploaded should be compared to evaluate if they are equivalent (size+name+md5+sha256 OR something similar OR some download ID) or some other technique to ensure the job has been previously correctly done. |
Make sure that upload can not be added twice to db to help with #11974
Should not harm: Why would user want to add upload twice and not update existing one?
For Example, if an upload failed and the user re-uploads, with this pr it updates the existing failed upload with "in progress" to try to upload it again instead of adding the same upload again and causing a conflict next time failed uploads are retried. (See Video)
In addition to that, fixes some issues that occur when duplicates of same upload are in upload list since most functions assume they find only one upload (see uploads tab in video on master)
Screen_recording_20240108_112327.webm
Master
Screen_recording_20240108_112525.webm
This PR