Uh oh!
There was an error while loading. Please reload this page.
ignore non existing users when retrieving details of group members - #13644
Conversation
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
| $usersDetails[$userId] = ['id' => $userId]; | ||
| } | ||
| } catch(OCSNotFoundException $e) { | ||
| // continue if a users ceased to exist. |
There was a problem hiding this comment.
Maybe at least log something?
What's the use case of having a list of users where the user does not exists here?
There was a problem hiding this comment.
The user is not added to the list when this Exception pops up. Or do you mean something else?
There was a problem hiding this comment.
I mean, I don't really like having blank catches :p
There was a problem hiding this comment.
It's not an error condition, but a valid scenario.
| # cf. https://github.com/nextcloud/server/issues/12991 | ||
| $data['storageLocation'] = $targetUserObject->getHome(); | ||
| } catch (NoUserException $e) { | ||
| throw new OCSNotFoundException($e->getMessage(), $e); |
There was a problem hiding this comment.
Why throw the OCS not found exception? This is mainly osmething to throw when the middleware will handle it. The NoUserException seems perfectly valid here.
There was a problem hiding this comment.
because it is also done in line 95 (https://github.com/nextcloud/server/pull/13644/files/4915d64de8d0ee862f0fdc92fe9bf856f3e8cbe1#diff-4d20146890eb1004590c5327656f93bdR95), so it is consistent and catches both cases.
so, dear reviewers, is it OK to go in? |
MorrisJobke
commented
Jan 24, 2019
@blizzz Backport to which branches? |
MorrisJobke
commented
Jan 24, 2019
/backport to stable15 |
MorrisJobke
commented
Jan 24, 2019
/backport to stable14 |
MorrisJobke
commented
Jan 24, 2019
Background: the report was against 14.0.4 |
The backport to stable14 failed. Please do this backport manually. |
backport to stable15 in #13792 |
rullzer
commented
Jan 29, 2019
@blizzz backport to 14 failed. Could you do that manually? |
blizzz
commented
Jan 30, 2019
yes, this was expected. doing it now. |
Fixes an exception leading to a 404 return of the user details request on the members of a specified group. Please read #12991 (comment) for detailed reasonings.
To reproduce
curl -H "OCS-APIRequest: true" "http://admin:password@my.dev.nc/ocs/v2.php/cloud/groups/group1/users/details"Before:
After: