diff options
author | Brendan Abolivier <babolivier@matrix.org> | 2019-06-28 15:17:15 +0100 |
---|---|---|
committer | Brendan Abolivier <babolivier@matrix.org> | 2019-06-28 15:22:16 +0100 |
commit | 01d0f8e701b4c2ddd04eee1a26edef952c0ac558 (patch) | |
tree | 3fae82ac7bb9ed7080ed8ddc3c8d2e3006719e3a /synapse | |
parent | Docker image: Add a migrate_config mode (#5567) (diff) | |
download | synapse-01d0f8e701b4c2ddd04eee1a26edef952c0ac558.tar.xz |
Don't update the ratelimiter before sending a 3PID invite
This would cause emails being sent, but Synapse responding with a 429 when creating the event. The client would then retry, and with bad timing the same scenario would happen again. Some testing I did ended up sending me 10 emails for one single invite because of this.
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/handlers/room_member.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/synapse/handlers/room_member.py b/synapse/handlers/room_member.py index 4d6e883802..c860acf970 100644 --- a/synapse/handlers/room_member.py +++ b/synapse/handlers/room_member.py @@ -676,7 +676,7 @@ class RoomMemberHandler(object): # We need to rate limit *before* we send out any 3PID invites, so we # can't just rely on the standard ratelimiting of events. - yield self.base_handler.ratelimit(requester) + yield self.base_handler.ratelimit(requester, update=False) can_invite = yield self.third_party_event_rules.check_threepid_can_be_invited( medium, address, room_id |