-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Make the name collision policy for auto uploads selectable #5810
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
Conversation
|
IT test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/13400-IT |
|
IT test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/13399-IT |
src/test/java/com/owncloud/android/ui/activity/SyncedFoldersActivityTest.java
Outdated
Show resolved
Hide resolved
|
IT test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/13406-IT |
src/main/java/com/owncloud/android/ui/dialog/parcel/SyncedFolderParcelable.java
Outdated
Show resolved
Hide resolved
src/main/java/com/owncloud/android/ui/dialog/parcel/SyncedFolderParcelable.java
Outdated
Show resolved
Hide resolved
|
Welcome on board 🎉 Some very very minor issues. |
ezaquarii
left a comment
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.
I don't like how we treat serialization/deserialization here - it's brittle and the logic is spraed into multiple points of interest.
Also, naming is of a concern here.
src/main/java/com/owncloud/android/ui/dialog/SyncedFolderPreferencesDialogFragment.java
Outdated
Show resolved
Hide resolved
src/main/java/com/owncloud/android/ui/dialog/SyncedFolderPreferencesDialogFragment.java
Outdated
Show resolved
Hide resolved
| return 0; | ||
| } | ||
|
|
||
| public void setNameCollisionPolicy(String nameCollisionPolicy) { |
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.
Did you mean setCollisionPolicyByName(String collisionPolicyName)? This function name does not make sense - it says that someobdy chooses a name for a collision policy.
I think it refers to the unfornately named NameCollisionPolicy type.
@tobiasKaminsky what do you think? can we fix it?
src/main/java/com/owncloud/android/ui/dialog/parcel/SyncedFolderParcelable.java
Outdated
Show resolved
Hide resolved
src/main/java/com/owncloud/android/datamodel/SyncedFolderDisplayItem.java
Show resolved
Hide resolved
src/main/java/com/owncloud/android/ui/dialog/parcel/SyncedFolderParcelable.java
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| public void setNameCollisionPolicy(String nameCollisionPolicy) { | ||
| switch (nameCollisionPolicy) { |
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.
This conversion could be folded into enum NameCollisionPolicy:
public static NameCollisionPolicy fromName(String policyName) { ... }
@tobiasKaminsky I think the name choosen for this concept is invalid. While here, we could rename it into CollisionPolicyName, so it respects english grammar rules. As it is now - it's just confusing.
As this is mainly c&p from the way I 🙈 handled this on other parts, I am fine to have this the same way for now, and refactor later. |
|
I tried to make the |
|
Unit test failed, but no output was generated. Maybe a preliminary stage failed. |
|
Screenshot test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/13467-Screenshot |
|
IT test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/13471-IT |
|
/backport to stable-3.11 |
|
@fodinabor I took the freedom to reformat the code a bit. |
|
Unit test failed, but no output was generated. Maybe a preliminary stage failed. |
|
Rebased and let us merge this tomorrow :-) |
|
Unit test failed, but no output was generated. Maybe a preliminary stage failed. |
|
@tobiasKaminsky can you take care of the spotbug counter? ❤️ |
Signed-off-by: Joachim Meyer <joachim@joameyer.de>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
|
Issues
======
+ Solved 8
Complexity increasing per file
==============================
- src/main/java/com/owncloud/android/providers/FileContentProvider.java 3
See the complete overview on Codacy |
|
Unit test failed, but no output was generated. Maybe a preliminary stage failed. |
|
IT test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/13531-IT |
|
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/13536.apk |
|
Unit test failed, but no output was generated. Maybe a preliminary stage failed. |
Codacy384Lint
SpotBugs (new)
SpotBugs (master)
|
|
IT test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/13536-IT |
|
Thanks @fodinabor for this awesome contribution! |
|
backport to stable-3.11 in #5883 |
|
Will it fix the issue from #5755 if remote file does not exist yet? It is a case for 100% new file, eg. photo just taken, definitely not stored on remote (server) side yer. However, sync conflict is still reported by client? |
|
v3.11.1 - not fixed for non-existing files. Strange as it seems to query... directory (not file). Following is apache access log when I click "conflicted file". App queries "getting remote version from server" (again, a file does not exist on server) and apache is reporting: Apr 25 00:26:46 PKSERVER apache[25696]: *******:443 192.168.10.1 - "PROPFIND /remote.php/webdav/Photos/Camera/ HTTP/1.1" 207 RX:1809 TX:2068 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.11.1" |

Resolves #5827
Fix #5755
Fix #5599
Fix #4260
Fix #5846
Since #4788 synching WhatsApp Backups or similar files that don't change their name to Nextcloud is horrible, as one is asked how the files should be handled for every single file every day (well - as often the files change..).
This PR adds the option for synced folders how name collisions with updated files should be handled.
The options are (as proposed in #5599):
Disclaimer: probably did not run all tests cleanly and did not update the screenshots, as that seemed nearly impossible on Windows..