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.
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
Reduce number of queries to read shares in a folder #34918
Reduce number of queries to read shares in a folder #34918
Changes from all commits
10bc136
1d3070b
641968d
7d57fbf
0aca9f1
093e47e
6054d48
c7f5d11
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Removing this means we don't filter by
$userId
at all anymore with$reshares = true
which is almost certainly incorrect.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.
I am also concerned about this change.
I have reverted it to check once again and I see that three integration tests fail consistently - in exactly the same way as when I started the PR.
Please see my comments above - esp. this one and this one.
I would welcome any suggestion how to fix this in a better way.
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.
Hi @icewind1991,
I have looked once again into this issue. I think I have a better understanding now.
One of the failing tests describes the following scenario:
server/build/integration/sharing_features/sharing-v1-part2.feature
Lines 306 to 318 in 96f0118
This scenario expects two shares to be returned for user1: user1 -> user2 and user2 -> user3. Obviously in the second share user1 is neither owner nor initiator - but the share should be returned anyway.
I have recreated data for this scenario in my test environment and tried to repeat the issue from the UI. I have not been able to repeat this in the UI, but I have noticed a discrepancy between the following two API calls:
In the first case the shares are retrieved by DefaultShareProvider::getSharesBy that contains the following fragment to handle the reshares mode:
server/lib/private/Share20/DefaultShareProvider.php
Lines 760 to 771 in 96f0118
Here the userId parameter is ignored in reshares mode when the node parameter is specified.
Before my changes the second API call was handled by invoking getSharesBy individually for each item in the folder.
In this PR I want to reuse better handling already available in DefaultShareProvider::getSharesInFolder.
So, to achieve consistency with previous behaviour - I think that the userId check should be removed from the getSharesInFolder method. The folder node must be provided, the code always adds an additional filter to retrieve only shares relevant to files/subfolders inside the provided folder.
server/lib/private/Share20/DefaultShareProvider.php
Lines 696 to 718 in 96f0118
Is my understanding correct? Or have I overlooked something?
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.
Hi @icewind1991,
Trying once again to move this PR forward. I rebased the changes yesterday and once again removed the
uid
check inreshares
mode. Please see my explanation in the comment above.This is the last major item still open on the list of performance issues in the Android app that I started over a year ago.
Would be great to get this merged.