summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@arasphere.net>2017-11-01 16:21:16 +0000
committerGitHub <noreply@github.com>2017-11-01 16:21:16 +0000
commit275826f234af2ea062fbec96c20d94bf044aad8c (patch)
treee34db59e760e95ee2faa7d4d9e9c66ae42b01a0f /synapse/storage
parentMerge pull request #2615 from matrix-org/rav/break_auth_device_dep (diff)
parentswitch to setting default displayname in the storage layer (diff)
downloadsynapse-275826f234af2ea062fbec96c20d94bf044aad8c.tar.xz
Merge pull request #2617 from matrix-org/matthew/auto-displayname
automatically set default displayname on register
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/registration.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/storage/registration.py b/synapse/storage/registration.py
index 3d3bdba894..65ddefda92 100644
--- a/synapse/storage/registration.py
+++ b/synapse/storage/registration.py
@@ -180,9 +180,11 @@ class RegistrationStore(background_updates.BackgroundUpdateStore):
             )
 
         if create_profile_with_localpart:
+            # set a default displayname serverside to avoid ugly race
+            # between auto-joins and clients trying to set displaynames
             txn.execute(
-                "INSERT INTO profiles(user_id) VALUES (?)",
-                (create_profile_with_localpart,)
+                "INSERT INTO profiles(user_id, displayname) VALUES (?,?)",
+                (create_profile_with_localpart, create_profile_with_localpart)
             )
 
         self._invalidate_cache_and_stream(