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

Deleting a room leaves clients with stuck rooms #16001

Open
reivilibre opened this issue Jul 25, 2023 · 3 comments
Open

Deleting a room leaves clients with stuck rooms #16001

reivilibre opened this issue Jul 25, 2023 · 3 comments
Labels
A-Moderation Tools for moderating HSes: event redaction, media removal, purge admin API, reports from users, ... A-Retention Retention rules to delete messages after a certain amount of time A-User-Experience O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@reivilibre
Copy link
Contributor

reivilibre commented Jul 25, 2023

When a room is deleted through start_shutdown_and_purge_room (e.g. using the admin API), the users in the room don't receive a leave event or any other signal that it should be removed from the room list.

This leaves clients with stuck rooms that cannot have messages sent into. When that happens, the issue can only be fixed manually by the user: the user has to 'Clear cache and reload' (or equivalent).

Noticed as at Synapse v1.88.0 (though I have heard this issue mentioned earlier too; older Synapse-dev discussion)

@reivilibre reivilibre added A-Moderation Tools for moderating HSes: event redaction, media removal, purge admin API, reports from users, ... S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. O-Uncommon Most users are unlikely to come across this or unexpected workflow A-User-Experience A-Retention Retention rules to delete messages after a certain amount of time labels Jul 25, 2023
@clokep
Copy link
Member

clokep commented Oct 26, 2023

Any thoughts on what we need to do to fix this? I guess we need to track the stream ordering + the local users who were in a room when it was purged so that we can then properly send it down sync?

@clokep
Copy link
Member

clokep commented Oct 26, 2023

older Synapse-dev discussion

To copy some of that conversation here:

There are kind of 2 problems with forgotten rooms and /sync

  • If you forget a room (i.e. a purge), clients might never receive their leave event, which leaves the room in the roomlist as joined, even though synapse doesn't know about it. This even happens without the include_leave.
  • If you forget a room, other clients for the same user won't know about this and will still show the room as historical. I don't think /sync has any way to transport that information to clients currently.

The first one probably could be fixed by storing at least some info to send to clients, even when the room was purged. I don't think the second issue can be solved without a spec change.

The subsequent conversation notes that the first point is likely the more important. In order to solve it:

I was thinking about storing a stream position at the time of purge, but it doesn't tell us to whom I should then send the leave events. I guess we need to keep entries in room_memberships forever ? that's annoying.

It is discussed a bit how you can then not store them forever, including:

  • An arbitrary date in the future (delete after 1 year).
  • Deleting it when a sync token past the recorded stream position is used. (It is unclear if this is really spec compliant?)

It is noted this is a similar issue to deleting account data.

@clokep
Copy link
Member

clokep commented Oct 26, 2023

The second problem seems to be matrix-org/matrix-spec#1458.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Moderation Tools for moderating HSes: event redaction, media removal, purge admin API, reports from users, ... A-Retention Retention rules to delete messages after a certain amount of time A-User-Experience O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

No branches or pull requests

2 participants