element-hq / element-hq/synapse
Room gets blocked when user tries to join and gets invited simultaneously
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
### Description
It's a strange situation: If some user tries to join an open room and, exactly at the same time (as long as "the same time" is possible) gets invited by someone inside the room, one will enter a situation where the user can't join as there are duplicate authentication events. The user also is not able to ignore the invitation, and can't leave the room either. Users inside the room report that the user has been added.
### Steps to reproduce
- find an existing room
- try to join
- simultaneously, have someone inside the room to invite you
### Homeserver
matrix.org
### Synapse Version
dunno
### Installation Method
I don't know
### Database
dunno
### Workers
Single process
### Platform
no idea
### Configuration
_No response_
### Relevant log output
```shell
MatrixError: [403] Event $eMRqyh3my2XKCyLUVGsNXKF1EtXM4XvzA87iLzQw9pY has duplicate auth_events for ('m.room.member', '@alexandre_ganso:matrix.org'): $CyEa7zjUJlqxJzumCzdybyLnJ6Rhodl8D0zZMC50iNg and $N8lykpeuOIquQWBnjK7kJsE8Wv3ODeV8aptIj6EF5zY (https://matrix-client.matrix.org/_matrix/client/v3/join/!haTzFkQbWypSWWocej%3Afz-juelich.de)
```
### Anything else that would be useful to know?
_No response_
Contributor guide
Research direction
Start with the /_matrix/client/v3/join endpoint and reproduce the concurrent join-and-invite sequence against matrix.org. Trace the duplicate auth_events reported for the m.room.member event and verify that the user can join, ignore the invitation, or leave without the room becoming blocked.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100