Skip to content

feat: refresh user mounts when removed from a group or circle that has associated team folders#2615

Draft
cristianscheid wants to merge 1 commit into
masterfrom
feat/noid/refresh-mounts-group-circle-member-removal
Draft

feat: refresh user mounts when removed from a group or circle that has associated team folders#2615
cristianscheid wants to merge 1 commit into
masterfrom
feat/noid/refresh-mounts-group-circle-member-removal

Conversation

@cristianscheid

@cristianscheid cristianscheid commented Jul 10, 2026

Copy link
Copy Markdown
Member
  • Resolves: #

Summary

When a team folder is shared with a group or circle, removing a member currently leaves a stale entry for that folder in oc_mounts until their next login.

This PR refreshes the user's mounts (removing the stale entry) upon detecting the following events:

  • OCP\Group\Events\UserRemovedEvent
  • OCA\Circles\Events\CircleMemberRemovedEvent

To avoid refreshing mounts unnecessarily, the refresh only runs if the group/circle actually has a team folder associated with it.

The refresh logic mirrors what the files:mount:refresh command already does:
https://github.com/nextcloud/server/blob/master/apps/files/lib/Command/Mount/Refresh.php#L45

This PR depends on the following PR being merged first, which introduces methods to check whether a given group or circle has a team folder shared with it:

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@cristianscheid cristianscheid self-assigned this Jul 10, 2026
@cristianscheid cristianscheid force-pushed the feat/noid/refresh-mounts-group-circle-member-removal branch from 2b0312a to a111729 Compare July 10, 2026 14:27
@cristianscheid cristianscheid marked this pull request as draft July 10, 2026 14:31
@cristianscheid

Copy link
Copy Markdown
Member Author

Converted to draft to wait for nextcloud/groupfolders#4884 to be merged first.

Comment thread lib/Listeners/CircleMemberRemoved.php Outdated
Comment thread lib/Listeners/CircleMemberRemoved.php Outdated
Comment thread lib/Listeners/GroupMemberRemoved.php Outdated
Comment thread lib/Listeners/GroupMemberRemoved.php Outdated
Comment thread lib/Listeners/GroupMemberRemoved.php
…s associated team folders

Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
@cristianscheid cristianscheid force-pushed the feat/noid/refresh-mounts-group-circle-member-removal branch from a111729 to 2dac9da Compare July 13, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants