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

[stable9.1] Fix unmerged shares repair targetdecision #25812

Merged

Conversation

PVince81
Copy link
Contributor

Forward port of #25543 (comment)

When repairing unmerged shares, make a better decision on which files_target to use to be closer to what the user expects.

@owncloud/sharing @DeepDiver1975

Vincent Petry added 2 commits August 16, 2016 11:08
Pick the most recent subshare that has no parenthesis from duplication
which should match whichever name the user picked last. If all
subshares have duplicate parenthesis names, use the least recent group
share's target instead.
Whenever a group share is created after a direct share, the stime order
needs to be properly considered in the repair routine, considering that
the direct user share is appended to the $subShares array and breaking
its order.
@PVince81
Copy link
Contributor Author

@SergioBertolinSG @jvillafanez can you help reviewing ? The test already makes sure it works as intended.

$pickedShare = null;
// sort by stime, this also properly sorts the direct user share if any
@usort($subShares, function($a, $b) {
if ($a['stime'] < $b['stime']) {
Copy link
Member

Choose a reason for hiding this comment

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

Worth to consider this solution to sort this: http://stackoverflow.com/a/2852918

@jvillafanez
Copy link
Member

Reviewed

@PVince81
Copy link
Contributor Author

PVince81 commented Aug 17, 2016

@jvillafanez as discussed, since this is a forward port, I'll address your comments in another PR + backports.

@jvillafanez
Copy link
Member

Comments will be addressed in a new PR so 👍

@PVince81 PVince81 merged commit 64d7887 into stable9.1 Aug 17, 2016
@PVince81 PVince81 deleted the stable9.1-fix-unmerged-shares-repair-targetdecision branch August 17, 2016 07:41
@lock
Copy link

lock bot commented Aug 5, 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 5, 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.

2 participants