-
Notifications
You must be signed in to change notification settings - Fork 87
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
Orphan records in oc_group_folders_manage are not cleaned up #2261
Comments
Actually there is already a listener for groups here, in public function boot(IBootContext $context): void {
$context->injectFn(function (IMountProviderCollection $mountProviderCollection, CacheListener $cacheListener, IGroupManager $groupManager): void {
$mountProviderCollection->registerProvider($this->getMountProvider());
$groupManager->listen('\OC\Group', 'postDelete', function (IGroup $group) {
$this->getFolderManager()->deleteGroup($group->getGID());
});
$cacheListener->listen();
});
} So all that is needed is:
|
This was fixed by #2504 |
Are you sure?
Is this happening? |
Also I don't see test coverage. But this is up to you. |
Right, sorry I missed that, let me reopen then |
How to use GitHub
Steps to reproduce
Expected behaviour
At (A), the 'tempgroup' and 'tempuser' is found in oc_group_folders_manage, oc_users and/or oc_groups, respectively.
At (B), the 'tempuser' is no longer found in either table.
At (C), the 'tempgroup' is no longer found in either table.
At (D), the response contains
{manage: []}
.Actual behaviour
At (B) and (C), an orphan record for 'tempuser' still exists in oc_group_folders_manage, even though it was removed from 'oc_users'.
At (C), an orphan record for 'tempgroup' still exists in oc_group_folders_manage, even though it was removed from 'oc_groups'.
At (D), the response contains
{manage: [[]]}
(nested empty array).Workaround
Currently, one way to clean up the orphan records through the API is to unset the ACL checkbox, through POST '/folders/{id}/acl' with acl=false. Then enable it again and restore the records.
Solution
The app must listen to users or groups being removed, and remove the orphan records when that happens.
I don't know how this would be done in Nextcloud, unfortunately :)
The text was updated successfully, but these errors were encountered: