Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Removing every member from a comminuty leaves behind a dead community #3023

Closed
dragetd opened this issue Mar 24, 2018 · 7 comments
Closed

Removing every member from a comminuty leaves behind a dead community #3023

dragetd opened this issue Mar 24, 2018 · 7 comments
Labels
z-p2 (Deprecated Label)

Comments

@dragetd
Copy link

dragetd commented Mar 24, 2018

If every member of a community leaves it, the community is still saved on the server and blocks the name. Like this (kind of accidental) test-community I created:
https://riot.im/app/#/group/+bobbycar:matrix.org

I could imagine that there are more ghost-communities on the servers. It would be nice if a community could be purged once it is empty.

@neilisfragile neilisfragile added enhancement z-p2 (Deprecated Label) labels Mar 27, 2018
@Kr4ken-9
Copy link

+1, created a test community: https://riot.im/app/#/group/+thanking:matrix.org and I can't reclaim the id.

@Matombo
Copy link
Contributor

Matombo commented Feb 20, 2019

+1 Just updated my merge request #3401 that would help with this issue.

@Matombo
Copy link
Contributor

Matombo commented Nov 29, 2019

There is now an api to remove a group https://github.com/matrix-org/synapse/blob/master/docs/admin_api/delete_group.md
What's missing is something that scans the server for empty groups and calls the api automatically.
At he Repo maintainers: Is there intresst in such an automation? Then i would try to code it.

@anoadragon453
Copy link
Member

anoadragon453 commented Dec 2, 2019

I would modify delete_group_summary_user to check whether there are any users left after deleting one, and if not then delete the group. Be aware that this function is called both from the CS API and the Federation API. Turns out this isn't where a user is actually removed. You'll want remove_user_from_group, which is what that admin servlet actually uses.

However, that would not cover the groups that are already dead and without users. For cleaning those up, I would create a delta file with a line of SQL to delete all groups without any remaining users in them. This will go when Synapse is first run after upgrade to a version containing this delta file.

@Matombo
Copy link
Contributor

Matombo commented Dec 2, 2019

Just a quick addition, the correct function to modify would be

def remove_user_from_group(self, group_id, user_id, requester_user_id, content):

I will look into it

@Matombo
Copy link
Contributor

Matombo commented Dec 16, 2019

Can be closed now can't it?

@dragetd
Copy link
Author

dragetd commented Dec 16, 2019

Yep!

@dragetd dragetd closed this as completed Dec 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
z-p2 (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

6 participants