element-hq / element-hq/synapse
Deleting a room leaves clients with stuck rooms
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
This issue has been migrated from [#16001](https://github.com/matrix-org/synapse/issues/16001).
---
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](https://matrix.to/#/!vcyiEtMVHIhWXcJAfl:sw1v.org/$mGwZ65WLgN-QTvqGDHNXKEB9rZU54pHyueuE_GIvFG0?via=matrix.org&via=element.io&via=bolha.chat))
Contributor guide
Research direction
Start by tracing the `start_shutdown_and_purge_room` flow and how the admin API triggers it. Reproduce room deletion with users present, then inspect how clients are notified about room membership and removal. Done means affected clients receive a signal that removes the deleted room without requiring a cache clear or reload.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100