This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Register race condition: User ID in use #5450
Labels
A-Registration
Creating an account
O-Uncommon
Most users are unlikely to come across this or unexpected workflow
S-Minor
Blocks non-critical functionality, workarounds exist.
T-Defect
Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
z-bug
(Deprecated Label)
z-p2
(Deprecated Label)
The registration endpoint uses set_session_data (https://github.com/matrix-org/synapse/blob/master/synapse/rest/client/v2_alpha/register.py#L486) and get_session_data (https://github.com/matrix-org/synapse/blob/master/synapse/rest/client/v2_alpha/register.py#L326) on the auth_handler to remember that it has registered a user for the UI auth session and return the same user on subsequent calls for idempotency.
Unfortunately there is enough code between these calls that when synapse is having a slow day, another rquest can come in and get past the get_session_data before the first has hit set_session_data, in which case one (some) of the requests return the User ID in use error rather than returning the same session.
The text was updated successfully, but these errors were encountered: