The last member of a room cannot `/forget` it after leaving
See original GitHub issueDescription
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
- leave a room
- try to forget the room via
/forget
or webclient - get
http 200
and nothing happens - there are no changes in db table
room_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 no forget_membership
txn
.
I have added two lines for debugging in room_member.py
logger.info("add info: %s", (membership,))
logger.info("add info: %s", (member,))
- If you are member of the room,
member
is aFrozenEventV3
andmembership
join
. Synapse raiseshttp 400
. 😄 - If you have left the room,
member
andmembership
isNone
. Nothing happens, onlyhttp 200
😢- If the user was the last member of the room
- If the user was not the last member,
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
see above
Anything else that would be useful to know?
Discovered while working on https://github.com/matrix-org/synapse/pull/13503#discussion_r944192792
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Memory Lapse or Dementia? 5 Clues to Help Tell the Difference
What's not: “Driving or walking for a long time without realizing you're lost or completely forgetting where you are, and not asking for...
Read more >It's not just doorways that make us forget what we came for in ...
Astoundingly, these studies show doorways cause forgetting, and this effect is so consistent it has come to be known as the “doorway effect”....
Read more >Why You Keep Forgetting Why You Entered a Room - VICE
The term was coined after a 2011 study by researchers at the University of Notre Dame, who found that people tend to forget...
Read more >When to be Concerned About Forgetfulness - Geisinger
It's common to forget things now and then, but here's how to know when to call your doctor. You were rushing to leave...
Read more >Forgot Why You Walked Into a Room? Tips for Brain Blips
Many of us misplace objects, forget why we walked into a room, or forget the name of someone we just met. Although such...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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
_background_remove_left_rooms
is deleting rows related to this room from the tablecurrent_state_events
. Thus when the/forget
request executes this line:the return value for
get_current_state_events
isNone
, as the tablecurrent_state_events
now has no rows related to the room. I did verify that after the last member leaves the room,get_current_state_events
no longer retains any rows from this room.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: