implement recommended recipient api for unified sharing - #63927
Conversation
provokateurin
left a comment
There was a problem hiding this comment.
My idea was to incorporate this into the existing search endpoint and have it trigger when the query is empty. I think this would simplify it a bit on the frontend/client side.
While the implementation with greater than instead of offset is much better than the Collaboration API provides, I don't think it is necessary, because in the current use case only a limited set of results is desired anyway (I think 3) and there is no pagination.
So I think making it part of the existing search endpoint would work and the query could just be limited to 3 all the time (without any sort of pagination).
If we want to have it work in a different way at some point, we can just do that later.
683c657 to
9b24e39
Compare
| // querying for the owner, with no further filters | ||
| ['shares' => [ | ||
| ['recipients' => [$recipient1, $recipient2], 'owner' => 'owner'] | ||
| ], 'user' => $owner, 'expected' => ['recipient1', 'recipient2']], |
There was a problem hiding this comment.
You can set these descriptions as keys for the array. PHPUnit will also log them on failure, which makes it easier to figure out which case is failing.
9b24e39 to
a98a1ac
Compare
Sounds good, will adjust it
Couldn't get the |
a98a1ac to
6f8f308
Compare
9e3f8b0 to
f52f21c
Compare
f52f21c to
c0c712f
Compare
|
/backport to stable35 |
|
@icewind1991 did you forget to push? |
|
|
||
| $query->selectColumns('recipient_class_id', 'recipient_value', 'recipient_instance', 'initiator_user_id', 'initiator_instance') | ||
| ->selectAlias($query->func()->count('*'), 'count') | ||
| ->from('sharing_share_recipients', 'r') |
There was a problem hiding this comment.
sharing_share_recipients only has a PK on id, no index on share_id or initiator_user_id. So this joins and groups over the whole table, and the NOT IN scans it again. The picker hits this on every open, which means two full scans each time on bigger instances. Can we add the indexes here?
|
Couple of small things:
|
6b7b2a8 to
755a063
Compare
755a063 to
605a957
Compare
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
605a957 to
328efec
Compare
Summary
Add api for suggesting recipients for a share
TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)