summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-03-24 13:23:11 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-03-24 13:23:11 +0000
commit698962af0a7126138c9efd55281ed43b5c67c0d7 (patch)
tree9f8ea7beae68b8b7cc94872a245a1c7542c777b4 /synapse/handlers
parentFix minor issues with email config (#6962) (diff)
parentUpsert room version when we join over federation (#6968) (diff)
downloadsynapse-698962af0a7126138c9efd55281ed43b5c67c0d7.tar.xz
Upsert room version when we join over federation (#6968)
* commit 'a301934f4':
  Upsert room version when we join over federation (#6968)
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/federation.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index cbeb92b8cc..f9f4358cc7 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -1327,16 +1327,18 @@ class FederationHandler(BaseHandler):
 
             logger.debug("do_invite_join event: %s", event)
 
-            try:
-                await self.store.store_room(
-                    room_id=room_id,
-                    room_creator_user_id="",
-                    is_public=False,
-                    room_version=room_version_obj,
-                )
-            except Exception:
-                # FIXME
-                pass
+            # if this is the first time we've joined this room, it's time to add
+            # a row to `rooms` with the correct room version. If there's already a
+            # row there, we should override it, since it may have been populated
+            # based on an invite request which lied about the room version.
+            #
+            # federation_client.send_join has already checked that the room
+            # version in the received create event is the same as room_version_obj,
+            # so we can rely on it now.
+            #
+            await self.store.upsert_room_on_join(
+                room_id=room_id, room_version=room_version_obj,
+            )
 
             await self._persist_auth_tree(
                 origin, auth_chain, state, event, room_version_obj