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.
pull/5576/head
Brendan Abolivier 2019-06-28 15:17:15 +01:00
parent 555b6fa0d5
commit 01d0f8e701
No known key found for this signature in database
GPG Key ID: 1E015C145F1916CD
1 changed files with 1 additions and 1 deletions

View File

@ -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