Properly handle deleted users in UserMountCache#3888
Conversation
|
@MorrisJobke, thanks for your PR! By analyzing the history of the files in this pull request, we identified @icewind1991, @nickvergessen and @rullzer to be potential reviewers. |
When encountering entries from a deleted user, discard such entries. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
7c5ab6f to
d4cd384
Compare
| private function dbRowToMountInfo(array $row) { | ||
| $user = $this->userManager->get($row['user_id']); | ||
| if (is_null($user)) { | ||
| // user does not exist any more, delete all mounts of that user directly |
There was a problem hiding this comment.
So in case your user backend (like ldap) has a hick-up or is temporarily wrong configured, everything will be whiped?
Sounds a bit odd, not sure if we should do this. I agree with the rest of this PR, but I'm not a friend of this delete query.
icewind1991
left a comment
There was a problem hiding this comment.
Would be better to just delete the rows when a user is deleted
@icewind1991 Could you create a PR for that? |
Or adjust this PR. Maybe the unit tests are still valid. |
When encountering entries from a deleted user, discard such entries.
@icewind1991 Does that make sense? You added the array_filter before and upstream added the deletion as well.