summary refs log tree commit diff
diff options
context:
space:
mode:
authorSean Quah <8349537+squahtx@users.noreply.github.com>2022-07-19 19:15:54 +0100
committerGitHub <noreply@github.com>2022-07-19 19:15:54 +0100
commit172ce29b149afb91bbf728b88bffb117172a8f2c (patch)
tree8b243ab3a2e9fec80985e821e6a1a4ddc591c570
parentAdd type annotations to `trace` decorator. (#13328) (diff)
downloadsynapse-172ce29b149afb91bbf728b88bffb117172a8f2c.tar.xz
Fix spurious warning when fetching state after a missing prev event (#13258)
-rw-r--r--changelog.d/13258.misc1
-rw-r--r--synapse/handlers/federation_event.py3
2 files changed, 4 insertions, 0 deletions
diff --git a/changelog.d/13258.misc b/changelog.d/13258.misc
new file mode 100644
index 0000000000..a187c46aa6
--- /dev/null
+++ b/changelog.d/13258.misc
@@ -0,0 +1 @@
+Fix spurious warning when fetching state after a missing prev event.
diff --git a/synapse/handlers/federation_event.py b/synapse/handlers/federation_event.py
index 766d9849f5..e4a5b64d10 100644
--- a/synapse/handlers/federation_event.py
+++ b/synapse/handlers/federation_event.py
@@ -1037,6 +1037,9 @@ class FederationEventHandler:
         # XXX: this doesn't sound right? it means that we'll end up with incomplete
         #   state.
         failed_to_fetch = desired_events - event_metadata.keys()
+        # `event_id` could be missing from `event_metadata` because it's not necessarily
+        # a state event. We've already checked that we've fetched it above.
+        failed_to_fetch.discard(event_id)
         if failed_to_fetch:
             logger.warning(
                 "Failed to fetch missing state events for %s %s",