Skip to content
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

Avoid duplicate files in google with the same name #4416

Merged
merged 3 commits into from
Apr 26, 2017
Merged

Avoid duplicate files in google with the same name #4416

merged 3 commits into from
Apr 26, 2017

Conversation

gvmura
Copy link
Contributor

@gvmura gvmura commented Apr 21, 2017

When it renames the temporary file, it tests if the file is already present. If so, it moves to trash the previous version to avoid duplicate files with the same name (message log: "Ignoring duplicate file name: ... on Google Drive for Google user: ...").
It doesn't handle duplicate files in Google Drive, it tries to avoid them.
You'll watch #4279 issue.

Logs file and images:
logs-images.zip

I tested owncloud 9.1.5 yesterday and I saw that when it uploads the file for the second time, it handles Google's versions. No "temporary" file is created in Google. So my fix isn't necessary in it.

When it renames the temporary file, it tests if the file is already present. If so, it moves to trash the previous version to avoid duplicate files with the same name (message log: "Ignoring duplicate file name: ... on Google Drive for Google user: ...").
It doesn't handle duplicate files in Google Drive, it tries to avoid them.
You'll watch #4279 issue.
Signed-off-by: gvmura <gvmura@uniss.it>
@codecov
Copy link

codecov bot commented Apr 21, 2017

Codecov Report

Merging #4416 into master will decrease coverage by <.01%.
The diff coverage is 0%.

@@             Coverage Diff              @@
##             master    #4416      +/-   ##
============================================
- Coverage     54.18%   54.17%   -0.01%     
- Complexity    21635    21638       +3     
============================================
  Files          1327     1327              
  Lines         82778    82786       +8     
  Branches       1312     1312              
============================================
- Hits          44853    44852       -1     
- Misses        37925    37934       +9
Impacted Files Coverage Δ Complexity Δ
apps/files_external/lib/Lib/Storage/Google.php 0% <0%> (ø) 147 <0> (+3) ⬆️
lib/private/Security/CertificateManager.php 92.78% <0%> (-1.04%) 38% <0%> (ø)
apps/files_external/lib/Lib/Storage/SMB.php 46.82% <0%> (-0.4%) 112% <0%> (ø)
lib/private/Server.php 93.35% <0%> (+0.14%) 120% <0%> (ø) ⬇️

@gvmura
Copy link
Contributor Author

gvmura commented Apr 21, 2017

I don't have much experience with Git.
If I made a mistake, sorry.

You can use my codes from yourself.

@gvmura
Copy link
Contributor Author

gvmura commented Apr 26, 2017

@MorrisJobke
I think it possibles to backport it in stable11.

@gvmura gvmura deleted the avoid-duplicate-files-google branch April 26, 2017 07:31
@MorrisJobke
Copy link
Member

cc @icewind1991 what do you think? Is this okay?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants