Skip to content
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

Retract knocks when deactivating accounts #16861

Closed
HarHarLinks opened this issue Jan 29, 2024 · 1 comment · Fixed by #17010
Closed

Retract knocks when deactivating accounts #16861

HarHarLinks opened this issue Jan 29, 2024 · 1 comment · Fixed by #17010

Comments

@HarHarLinks
Copy link
Contributor

Description

When deactivating a user, synapse goes through a cleanup process which includes steps to remove the user from the federation. This includes parting all joined rooms and rejecting pending invites:

# Now start the process that goes through that list and
# parts users from rooms (if it isn't already running)
self._start_user_parting()
# Reject all pending invites for the user, so that the user doesn't show up in the
# "invited" section of rooms' members list.
await self._reject_pending_invites_for_user(user_id)

MSC2403 introduced knocking. Knocks similarly to invites linger until either retracted or approved/denied by another actor. Hence, similar to pending invites being shown in the room member list, knocks would usually also be shown to at least those room members with sufficient power level to manage them.

The synapse cleanup routine should also take care of pending knocks, setting them to leave instead.
This could be done by replacing the call to get_rooms_for_user() with a cloned one that does not only consider JOIN but also KNOCK

"membership": Membership.JOIN,

or a new function similar to
async def _reject_pending_invites_for_user(self, user_id: str) -> None:

but I could not find an existing method to list a user's pending knocks yet, so that would need to also be added.

Steps to reproduce

  • knock on a room
  • deactivate user
  • as the room admin, see the pending knock sticking around

Homeserver

another

Synapse Version

1.93

Installation Method

Docker (matrixdotorg/synapse)

Database

psql, single, not ported, probably yes

Workers

Single process

Platform

k8s rancher

Configuration

  • presence off
  • retention off
  • no modules

Relevant log output

n/a

Anything else that would be useful to know?

No response

@clokep
Copy link
Contributor

clokep commented Jan 29, 2024

Sounds similar to matrix-org/synapse#16559.

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 a pull request may close this issue.

2 participants