-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat(files_sharing): Add types filter to share API
#51312
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
base: master
Are you sure you want to change the base?
Conversation
susnux
left a comment
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.
Not sure we need two requests to the backend, we also can just filter on the frontend
provokateurin
left a comment
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.
Agreed, the filtering should be done on the frontend.
Also this breaks other API users because you introduce a new field without a default value that is the same as the current behavior.
I think having this in the API is necessary. An API that returns different types of shares should naturally support filtering by type. Beyond this specific use case, I’m actually surprised that this wasn’t already possible in the cc: @susnux
That is not true. This change is not a breaking change. Omitting the parameter results in the current behavior, returning all shares as expected. Internal and external apps will continue to function as before. cc: @provokateurin Generally, this increases performance, especially for instances/users with a sizable number of shares, Splitting and parallelizing the request has clear benefits and some drawbacks and so does frontend filtering. The new new API option/field, is a valuable addition because asides giving the client more flexibility it does not change current behavior, as long as it gets into the |
I am not sure here.
So I do not see any benefit here as the shares are requested the same way, there is no shortcut taken while fetching the shares, only formatting them is skipped. But this means now we have two fetch all shares 2 times iterate overthem and filter them. |
6339447 to
cca22cb
Compare
If making two requests results to smaller response sizes then, it is generally faster. The different components can render as the data is available.
This is a legitimate concern, I have added a commit to avoid fetching ALL shares, as the method that does it sequentially iterates over all the providers, if we simply pass the types (providers) to this method, then it stops most of this problem. server/apps/files_sharing/lib/Controller/ShareAPIController.php Lines 1872 to 1880 in bb6b462
The issue of more requests -> more server load remains nonetheless this kind of filtering is usually handled at the backend and even we do not want to use it here, I still think it is essential that shares can be filtered by type. cc: @susnux |
nfebe
left a comment
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 aware of the missing openapi update, had some issues with composer exec generate-spec.
While the main reviews are being cleared that would be handled.
|
I'm mostly siding with @susnux here and my previous comments were under the assumption that the providers were told which share types to query (because I didn't look at the code further). |
cca22cb to
55ae3e4
Compare
|
/compile |
508eb9d to
7dcd393
Compare
types filter to share API
|
I've moved the fix to: #52423. |
Improve the OCS files sharing API to include a share type filter in `getShares` Signed-off-by: nfebe <[email protected]>
Signed-off-by: nfebe <[email protected]>
With the types filter in place (1e7f53e) we should avoid, fetching all shares. Preventing potential N+1s Signed-off-by: nfebe <[email protected]>
7dcd393 to
6aaba03
Compare
Description
Add share filtering to Share API