dendrite
dendrite copied to clipboard
Rooms are not completely forgotten
Background information
- Dendrite version or git SHA: 0.6.3
- Monolith or Polylith?: monolith
- SQLite3 or Postgres?: postgres
- Running in Docker?: no
go version: 1.17.6- Client used (if applicable): element, curl
Description
- What is the problem: After all users who were in a room have sent forget commands for it, the room remains in the DB, and tends to reappear in Element as a "historical room" when logging in to a new session.
- Who is affected: Dendrite users / homeservers
- How is this bug manifesting: Before joining #dendrite:matrix.org was fixed, after failing to join this room and telling the server to forget it, and checking no other user on the homeserver had joined it, the related errors would continue to be logged at intervals even after restarting, upgrading, deleting ~/jetstream.
- When did this first appear: don't think it ever worked, it appears that every test room I've ever been in still exists in the DB
Steps to reproduce
- Sending forget for a room I have never been in returns HTTP 500 and logs:
level=error msg="QueryMembershipForUser: could not query membership for user" error="QueryMembershipForUser: unknown room !BIDAeUqYWNCjRLhRdj:matrix.org" req.id=33tPGmRi87uq req.method=POST req.path="/_matrix/client/r0/rooms/!BIDAeUqYWNCjRLhRdj:matrix.org/forget" roomID="!BIDAeUqYWNCjRLhRdj:matrix.org" userID="@bones_was_here:xonotic.org" user_id="@bones_was_here:xonotic.org" - Sending forget for a room I have been in returns HTTP 200 and logs nothing at info level (regardless of how many times the command is issued, server is restarted, jetstream deleted)
I would expect that once a room had been forgotten, sending the forget command would produce the same result that it does for a room I was never in.
Same for me
Right, currently there's just a flag that marks a room as forgotten, there's no check if you're that last one in that room and no clean up. I'll try to have a look at this next week.
Maybe fixed by https://github.com/matrix-org/dendrite/pull/2643? (rooms showing up as historical rooms) The HTTP 500 should already be fixed, iirc.
I am randomly getting rooms I previously left back as historical too I'm on 9dc5712 so I don't think it is fixed
Another try: Is this still happening? Haven't seen it happen for some time now, even when logging in to a new session or doing initial syncs.
I havn't seen old rooms reappear in the UI for a long time, but afaict they are still stored forever in the DB.
I haven't seen it happen again in new sessions yet, however sessions that previously were affected still show "historical" Empty Rooms
Closing as people haven't seen this in new sessions. Please make a new issue to report this reoccuring.
Is there a way to clear the historical empty rooms?
not without a cache clear at the very least.