From f2690c64230557701692e16264f2e65a21edab4d Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Fri, 2 Sep 2016 19:23:22 +0100 Subject: [PATCH] Fix membership changes to be idempotent --- synapse/handlers/room_member.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/synapse/handlers/room_member.py b/synapse/handlers/room_member.py index 3ba5335af..ba49075a2 100644 --- a/synapse/handlers/room_member.py +++ b/synapse/handlers/room_member.py @@ -85,6 +85,12 @@ class RoomMemberHandler(BaseHandler): prev_event_ids=prev_event_ids, ) + # Check if this event matches the previous membership event for the user. + duplicate = yield msg_handler.deduplicate_state_event(event, context) + if duplicate is not None: + # Discard the new event since this membership change is a no-op. + return + yield msg_handler.handle_new_client_event( requester, event,