-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Auto upload can compare local and remote files. #7894
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 means that you download the entire file, or?
What is the purpose of it?
Uh oh!
There was an error while loading. Please reload this page.
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.
A file is downloaded only if another file with the same name and the same size exists on a remote server. In that way the app can decided if the file was uploaded already or it is new one. If the file is new notification about conflict is displayed.
It would be better to use some kind of hash for that but it seems that it is impossible with current nextcloud API.
Let me know if you interested in the idea. Than I will fix a few things in this patch.
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.
Downloading the file is unfortunately something we should not do.
Imagine you have 50 conflicts, or conflicts with very big files (>2Gb).
Let us ask at server repo to get such an endpoint/info directly:
nextcloud/server#25949
In general I really like the idea, but we always need to be aware of such edge cases.
I would vote for closing this PR for now, and see if / what is discussed on server issue and then work further on this afterwards?
Uh oh!
There was an error while loading. Please reload this page.
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.
Now during conflict default behavior is "Ask me every time". I added another option "Ask me if files are different". Downloading file just to compare the content is not the best idea. Still it seems to be better than asking an user regarding each file (I have over 7000 photos) after resetting (db) the app.
I though about adding hash to server side but there was already a few attempts and all of them were rejected. E.g. nextcloud/server#22495
For now downloading and comparing files during conflict seems to be the best option. It could be easily adjusted later on when/if server supports hash API.
BTW even if there are many big files most likely it won't use more data transfer than current options. Rename new version, Overwrite remote version - those will re-upload so transfer will be wasted anyway, Skip uploading - only this save the data transfer. Also for now there is no way for user to know if local and remote files are the same or not.