element-hq / element-hq/synapse
Setting profile + joining a room can race (SYN-787)
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 6h
- Merged PRs (30d)
- 46
Description
This issue has been migrated from [#1444](https://github.com/matrix-org/synapse/issues/1444).
---
The Slack bridge appears to be triggering a race condition of some kind in synapse that most regular users would be too slow to provoke. Namely, that if concurrently a client tries to set a displayname/avatar image and join a room, the member event in the room never ends up with that profile information.
For example, the user `@_slack_decentralizedweb_U1BLXG620:matrix.org` is in the room `!WBhcGXTDMlzyTPWoJv:matrix.org` (which is `##decentralizedweb-general:matrix.org`. The user themself does have a profile set:
```
$ matrixtool client -u @LeoNerd:matrix.org json /_matrix/client/r0/profile/@_slack_decentralizedweb_U1BLXG620:matrix.org
{
"displayname" : "pfrazee",
"avatar_url" : "mxc://matrix.org/SBrnbsCSCpVFLZOArSPNaSni"
}
```
However, their `m.room.member` event in the room does not contain this information:
```
$ matrixtool client -u @LeoNerd:matrix.org json /_matrix/client/r0/rooms/'!WBhcGXTDMlzyTPWoJv:matrix.org'/state/m.room.member/@_slack_decentralizedweb_U1BLXG620:matrix.org
{
"membership" : "join",
"displayname" : null,
"avatar_url" : null
}
```
(Imported from https://matrix.org/jira/browse/SYN-787)
(Reported by @leonerd)
Contributor guide
Assessment
This issue has not been assessed yet.