Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Setting profile + joining a room can race (SYN-787) #1444

Open
matrixbot opened this issue Oct 12, 2016 · 3 comments
Open

Setting profile + joining a room can race (SYN-787) #1444

matrixbot opened this issue Oct 12, 2016 · 3 comments
Labels
T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@matrixbot
Copy link
Member

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)

@matrixbot
Copy link
Member Author

Jira watchers: @leonerd

@matrixbot
Copy link
Member Author

I'm aware that setting a profile and joining a room isn't well-defined, but I would expect that by the time both requests have finished, the user will be present in the room and their member event in that room would have the correct profile in it. Whether other users see them join with the profile already set, or if they join first and then it updates, would be undefined.

-- @leonerd

@matrixbot
Copy link
Member Author

I've now fixed the code for the bridge not to provoke this bug, and bumped the member event for all the ghost users to fix their profile details, so this is no longer directly affecting the bridged users. But would be nice to fix the underlying race condition regardless.

-- @leonerd

@matrixbot matrixbot changed the title Setting profile + joining a room can race (SYN-787) Setting profile + joining a room can race (https://github.com/matrix-org/synapse/issues/1444) Nov 7, 2016
@matrixbot matrixbot changed the title Setting profile + joining a room can race (https://github.com/matrix-org/synapse/issues/1444) Setting profile + joining a room can race (SYN-787) Nov 7, 2016
@MadLittleMods MadLittleMods added the T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. label May 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

No branches or pull requests

2 participants