-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add batch action to allow sharing with multiple guests at once #506
Conversation
Note that the requirement owncloud/core#40155 has been merged Any progress? |
Should we use sets instead of arrays to hold the users? It should be more efficient than looping through an array multiple times, and the code might also be smaller and easier. |
I wonder, how error handling works here? If 1 user in a batch fails for whatever reason, what happens with a batch? how is this presented to the user? |
@jvillafanez Do you mean here in L92: https://github.com/owncloud/guests/pull/506/files#diff-1e9748771effcb66e011a800b732cd0d897ea35001b2b40e9e9f7c970673ec7cR92?
In an error case, all users who succeed will still be added. Failed users will be left out and prompted to the user: |
Yes. I assume that both the result and the existing shares are arrays, and we can't change it, but we're creating an array for the users from the search. I'm not sure if we can skip the user loop somehow to take full advantage of the set operations. The goal would be to reduce the number of loops we need to do. Anyway, the expected data set for the users, shares and result shouldn't be too big, so it could be ok. |
Okay got it, I already tried it in owncloud/customgroups#521 (which is a similar care), unfortunately Sets do not support uniqueness with objects. Hence we would still need to loop through those. Or use some helpers from lodash, that probably do the same under the hood. |
Kudos, SonarCloud Quality Gate passed! |
This is included in https://github.com/owncloud/guests/releases/tag/v0.11.0-rc.1 |
Description
This feature allows sharing resources with multiple guests at once via the following format: user1@mail.com,user2@mail.com,user3@mail.com
Requires owncloud/core#40155 to work. Merging this PR still keeps compatibility with older oC versions though.
Related Issue
Types of changes