tulir / gomuks

A Matrix client written in Go.
https://maunium.net/go/gomuks
GNU Affero General Public License v3.0
1.37k stars 122 forks source link

Empty Direct Message Rooms Persisting After Leaving #162

Closed obyxcc closed 1 week ago

obyxcc commented 4 years ago

I seem to have a lot of "Empty Rooms" in my direct messages I can still open in the client. I have left these rooms and no one is in them. I've tried running /leave from within them and nothing happens.

tulir commented 4 years ago

The problem is most likely how gomuks handles m.direct account data: https://github.com/tulir/gomuks/blob/v0.1.2/matrix/matrix.go#L740-L741

residualmind commented 3 years ago

Is there a simple way to clean this up server-side - for instance via the Synapse API and an admin account? I wouldn't mind running clean-up scripts..

kfatehi commented 1 year ago

I spent a few hours to no avail trying to implement tulir's TODO comment of checking room membership. I tried two ways:

  1. Using https://spec.matrix.org/latest/client-server-api/#get_matrixclientv3roomsroomidmembers but this API did not give the expected result of my user not being in the room. I tried various ways to get at the content but gave up on it as it seemed unnecessary in the first place to make an API call in this function.
  2. Using the Room's GetMembers function, but it appears that the sync has not finished yet by this point in the code, so it's not possible to get the membership information yet. It's just too early.

Eventually I just chose to follow the Element /devtools procedure and as pointed out in that comment it is probably more important to determine why these leftover rooms come into existence in the first place. FWIW I'm using dendrite and testing locally w/ only two accounts but I have no idea how I created that empty toom.