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

[stable10] Fix folder upload race condition #29435

Merged
merged 1 commit into from
Nov 6, 2017

Conversation

PVince81
Copy link
Contributor

@PVince81 PVince81 commented Nov 3, 2017

Backport of #29393 to stable10

@PVince81 PVince81 added this to the development milestone Nov 3, 2017
@PVince81 PVince81 self-assigned this Nov 3, 2017
@codecov
Copy link

codecov bot commented Nov 3, 2017

Codecov Report

Merging #29435 into stable10 will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##             stable10   #29435   +/-   ##
===========================================
  Coverage       59.25%   59.25%           
  Complexity      17766    17766           
===========================================
  Files            1062     1062           
  Lines           59513    59513           
===========================================
  Hits            35264    35264           
  Misses          24249    24249

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d02bdc...0d0d3d7. Read the comment docs.

When uploading the same folder twice, sometimes a race condition is
triggered where some of the first uploaded items finish faster and
trigger the "end of transfer" event even though there are further items
to upload.

This fix prevents the end of transfer event to clear the list of uploads
so it can continue.
@PVince81 PVince81 force-pushed the stable10-fix-folder-upload branch from 89a761f to 0d0d3d7 Compare November 6, 2017 09:01
}
var path = OC.joinPaths(basePath, this.getFile().relativePath || '', this.getFile().name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather move the this.getFile().relativePath || '' up to avoid the operation being evaluated in the function because it isn't common, but taking into account this is the only change I see for a backport, I'm fine to leave this as tech debt.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Considering that this isn't happening in a big loop I think this bit is acceptable.

@PVince81 PVince81 merged commit 4c40c47 into stable10 Nov 6, 2017
@PVince81 PVince81 deleted the stable10-fix-folder-upload branch November 6, 2017 13:43
@lock
Copy link

lock bot commented Aug 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants