dendrite icon indicating copy to clipboard operation
dendrite copied to clipboard

Rooms are not completely forgotten

Open bones-was-here opened this issue 3 years ago • 4 comments

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.

bones-was-here avatar Feb 11 '22 03:02 bones-was-here

Same for me

alistair23 avatar Feb 18 '22 10:02 alistair23

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.

S7evinK avatar Feb 26 '22 15:02 S7evinK

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.

S7evinK avatar Aug 16 '22 08:08 S7evinK

I am randomly getting rooms I previously left back as historical too I'm on 9dc5712 so I don't think it is fixed

tux93 avatar Aug 24 '22 18:08 tux93

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.

S7evinK avatar Oct 20 '22 11:10 S7evinK

I havn't seen old rooms reappear in the UI for a long time, but afaict they are still stored forever in the DB.

bones-was-here avatar Oct 20 '22 13:10 bones-was-here

I haven't seen it happen again in new sessions yet, however sessions that previously were affected still show "historical" Empty Rooms

tux93 avatar Nov 14 '22 09:11 tux93

Closing as people haven't seen this in new sessions. Please make a new issue to report this reoccuring.

kegsay avatar Dec 06 '22 12:12 kegsay

Is there a way to clear the historical empty rooms?

alistair23 avatar Dec 06 '22 21:12 alistair23

not without a cache clear at the very least.

kegsay avatar Dec 07 '22 15:12 kegsay