Skip to content

Conversation

@max65482
Copy link
Contributor

Summary

Unlike user shares, group shares were not deleted when the group was deleted. This lead to dangling group shares (calenders shared with groups that didn't exist anymore). This PR removes all group shares upon deletion.

Checklist

@max65482 max65482 requested a review from a team as a code owner December 13, 2025 21:55
@max65482 max65482 requested review from ArtificialOwl, CarlSchwan, come-nc and icewind1991 and removed request for a team December 13, 2025 21:55
Copy link
Contributor

@come-nc come-nc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct to me but I’d like a review from someone with more knowledge of the dav application.

@SebastianKrupinski SebastianKrupinski force-pushed the fix_dangling_group_shares branch from 534a7de to 1fdbc84 Compare January 18, 2026 18:57
Copy link
Contributor

@SebastianKrupinski SebastianKrupinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good so far...

Comment on lines 142 to 145
public function postDeleteGroup(string $gid): void {
$this->calDav->deleteAllSharesByUser('principals/groups/' . $gid);
$this->cardDav->deleteAllSharesByUser('principals/groups/' . $gid);
}
Copy link
Contributor

@SebastianKrupinski SebastianKrupinski Jan 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks for groups with special characters like spaces that get replaced with "+"... Tested with "Test Group A"...

$event->getGroup()->getGID() returns "Test Group A" but the actual uri is "Test+Group+A" so the deletion fails and the group is not deleted.

Image Image

Also tested with a renamed group, started with "Test Group 2" then renamed to "Test Group B" although the label of the group is changed... the uri stays the same... and the group is not deleted.

Copy link
Contributor Author

@max65482 max65482 Jan 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find!
Pushed a new commit. This should fix the first case.
I could not reproduce the second case. Can you check it again with a changed group name without spaces (you have both cases otherwise)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't stop sharing to old unexistent group

3 participants