Skip to content

Commit

Permalink
Merge pull request matrix-org#1067 from matrix-org/markjh/idempotent
Browse files Browse the repository at this point in the history
Fix membership changes to be idempotent
  • Loading branch information
NegativeMjark committed Sep 5, 2016
2 parents 81b94c5 + f2690c6 commit 274c2f5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions synapse/handlers/room_member.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ def _local_membership_update(
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,
Expand Down

0 comments on commit 274c2f5

Please sign in to comment.