From 1a49e23555caaaad8b545a19e910c87bb16dc20d Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Wed, 7 Oct 2020 09:31:06 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Patrick Cloke --- synapse/handlers/federation.py | 2 +- synapse/storage/persist_events.py | 4 ++-- tests/handlers/test_message.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py index 3e4458a0ad..93211b2bae 100644 --- a/synapse/handlers/federation.py +++ b/synapse/handlers/federation.py @@ -2968,7 +2968,7 @@ class FederationHandler(BaseHandler): assert self.storage.persistence # Note that this returns the events that were persisted, which may not be - # the same as we passed in if some were deduplicated due transaction IDs. + # the same as were passed in if some were deduplicated due to transaction IDs. events, max_stream_token = await self.storage.persistence.persist_events( event_and_contexts, backfilled=backfilled ) diff --git a/synapse/storage/persist_events.py b/synapse/storage/persist_events.py index 0636e17142..97e63a1dfc 100644 --- a/synapse/storage/persist_events.py +++ b/synapse/storage/persist_events.py @@ -310,9 +310,9 @@ class EventsPersistenceStorage: return replaced_events # Check if any of the events have a transaction ID that has already been - # persitsed, and if so we don't persist again. + # persisted, and if so we don't persist it again. # - # We should have checked this a long time before we get here, but its + # We should have checked this a long time before we get here, but it's # possible that different send event requests race in such a way that # they both pass the earlier checks. replaced_events = await self.main_store.get_already_persisted_events( diff --git a/tests/handlers/test_message.py b/tests/handlers/test_message.py index f958f30796..232c915e10 100644 --- a/tests/handlers/test_message.py +++ b/tests/handlers/test_message.py @@ -60,7 +60,7 @@ class EventCreationTestCase(unittest.HomeserverTestCase): "sender": requester.user.to_string(), "content": {"msgtype": "m.text", "body": "Hello"}, }, - token_id=4957834, + token_id=token_id, txn_id=txn_id, ) )