-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
The last member of a room cannot /forget
it after leaving
#13517
Comments
/forget
)/forget
it
/forget
it/forget
it after leaving
This is reproducible-I wrote a unit test to reproduce this, and did some debugging. I suspect that after the last member leaves the room, the background update
the return value for |
Is there an idea how to fix it? |
@dklimpel I think that would be fine, even if the case of you later rejoining the room. It would be good to have a test for rejoining a room included with a fix though, to weed out any other potential gotchas. But in theory it should work. My only worry is whether it's a bit flaky to rely on the function returning |
@anoadragon453 I have created a test in #13503 in DB layer. synapse/tests/storage/test_roommember.py Lines 189 to 207 in 8fa7eb8
This issue needs additonal tests in handlers layer.
Do you create a PR for this test or can post your test here? |
I didn't create a PR, it was just some hacky code to try and reproduce the situation. If it's helpful, here it is:
|
Description
If you call
POST /_matrix/client/v3/rooms/{roomId}/forget
the user does not forget the room.This only seems to occur when the user was the last member.
Steps to reproduce
/forget
or webclienthttp 200
and nothing happensroom_memberships
If you run Synapse in SQL debug mode you can see the db runs
synapse.storage.txn - 691 - DEBUG - POST-148 - [TXN START] {get_filtered_current_state_ids-3c6}
but noforget_membership
txn
.synapse/synapse/handlers/room_member.py
Lines 1912 to 1927 in e825f73
synapse/synapse/storage/databases/main/roommember.py
Lines 1478 to 1499 in e825f73
I have added two lines for debugging in
room_member.py
member
is aFrozenEventV3
andmembership
join
. Synapse raiseshttp 400
. 😄member
andmembership
isNone
. Nothing happens, onlyhttp 200
😢member
is aFrozenEventV3
andmembership
leave
Homeserver
another homeserver
Synapse Version
Synapse/1.65.0rc1
Installation Method
Debian packages from packages.matrix.org
Platform
vm: Ubuntu 20.04.4 LTS
Relevant log output
Anything else that would be useful to know?
Discovered while working on #13503 (comment)
The text was updated successfully, but these errors were encountered: