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

Creating second share to user who renamed received folder creates a second entry #25568

Merged
merged 2 commits into from
Jul 26, 2016

Conversation

PVince81
Copy link
Contributor

Steps

  1. Create a user "user1" in a group "group1"
  2. As admin, share a folder "test" with "group1"
  3. Login as "user1"
  4. Rename "test" to "test_renamed"
  5. Login as "admin"
  6. Share "test" with "user1"
  7. Login as "user1" and check folders

Expected result

Only one folder "test_renamed" appear

Actual result

Two folders, "test" and "test_renamed".
Also happens when sharing first with "user1" and "group1"

Versions

Regression since OC 9.0, works fine in OC 8.2.7.

This PR brings an integration test to cover this case.
On master there were fixes regarding to grouping for #24575 but they failed to cover this specific case.
Let's address this inside this PR.

@owncloud/sharing

@mention-bot
Copy link

@PVince81, thanks for your PR! By analyzing the annotation information on this pull request, we identified @SergioBertolinSG, @rullzer and @LukasReschke to be potential reviewers

In some situations, a group share is created before a user share, and
the recipient renamed the received share before the latter is created.
In this situation, the "file_target" was already modified and the second
created share must align to the already renamed share.

To achieve this, the MountProvider now groups only by "item_source"
value and sorts by share time. This makes it so that the least recent
share is selected as super-share and its "file_target" value is then
adjusted in all grouped shares.

This fixes the issue where this situation would have different
"file_target" values resulting in two shared folders appearing instead
of one.
@PVince81
Copy link
Contributor Author

@owncloud/sharing @rullzer please review carefully

@rullzer I hope that my usage of moveShare here to adjust the file_target is ok. It seems to work and it shouldn't have any side effects, correct ?

@PVince81
Copy link
Contributor Author

PVince81 commented Jul 22, 2016

TODOs after merge:

@rullzer
Copy link
Contributor

rullzer commented Jul 22, 2016

@PVince81 yes that is the correct usage.

👍

@PVince81
Copy link
Contributor Author

@DeepDiver1975 can the Jenkinsfile thing be ignored ?

hudson.plugins.git.GitException: Failed to fetch from https://github.com/ownCloud/core.git

If yes, please merge.

@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.

4 participants