Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Don't update the ratelimiter before sending a 3PID invite #5576

Merged
merged 3 commits into from
Jun 28, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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.
  • Loading branch information
babolivier committed Jun 28, 2019
commit 01d0f8e701b4c2ddd04eee1a26edef952c0ac558
2 changes: 1 addition & 1 deletion synapse/handlers/room_member.py
Original file line number Diff line number Diff line change
@@ -676,7 +676,7 @@ def do_3pid_invite(

# 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