summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2021-09-22 15:20:18 +0100
committerGitHub <noreply@github.com>2021-09-22 15:20:18 +0100
commit8f2a52766bc242c02a309f45406f827e670311e7 (patch)
tree6e08e07433f9247230d8e60a093f6e036c252266
parentInclude more information in oEmbed previews. (#10819) (diff)
downloadsynapse-8f2a52766bc242c02a309f45406f827e670311e7.tar.xz
Ensure we mark sent knocks as outliers (#10873)
Diffstat (limited to '')
-rw-r--r--changelog.d/10873.bugfix1
-rw-r--r--synapse/handlers/federation.py7
2 files changed, 8 insertions, 0 deletions
diff --git a/changelog.d/10873.bugfix b/changelog.d/10873.bugfix
new file mode 100644
index 0000000000..32b2e50fd9
--- /dev/null
+++ b/changelog.d/10873.bugfix
@@ -0,0 +1 @@
+Fix a bug introduced in Synapse 1.37.0 which caused `knock` events which we sent to remote servers to be incorrectly stored in the local database.
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 8e2cf3387a..a03d77dffd 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -593,6 +593,13 @@ class FederationHandler(BaseHandler):
             target_hosts, room_id, knockee, Membership.KNOCK, content, params=params
         )
 
+        # Mark the knock as an outlier as we don't yet have the state at this point in
+        # the DAG.
+        event.internal_metadata.outlier = True
+
+        # ... but tell /sync to send it to clients anyway.
+        event.internal_metadata.out_of_band_membership = True
+
         # Record the room ID and its version so that we have a record of the room
         await self._maybe_store_room_on_outlier_membership(
             room_id=event.room_id, room_version=event_format_version