summary refs log tree commit diff
path: root/synapse/handlers/room_member.py
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2016-09-05 10:21:25 +0100
committerGitHub <noreply@github.com>2016-09-05 10:21:25 +0100
commit274c2f50a5d222ee2c433f30be45541f5fee3805 (patch)
treef45d0b551ccf291abd20105fd8ce38f584560158 /synapse/handlers/room_member.py
parentMerge pull request #1066 from matrix-org/markjh/direct_to_device_lowerbound (diff)
parentFix membership changes to be idempotent (diff)
downloadsynapse-274c2f50a5d222ee2c433f30be45541f5fee3805.tar.xz
Merge pull request #1067 from matrix-org/markjh/idempotent
Fix membership changes to be idempotent
Diffstat (limited to 'synapse/handlers/room_member.py')
-rw-r--r--synapse/handlers/room_member.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/handlers/room_member.py b/synapse/handlers/room_member.py
index 3ba5335af7..ba49075a20 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,