-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: create bounce collection and alarms #131
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mantariksh
force-pushed
the
bounce-coll
branch
from
August 13, 2020 03:57
5a6bae9
to
7b2385d
Compare
mantariksh
force-pushed
the
bounce-coll
branch
2 times, most recently
from
August 17, 2020 08:00
d372679
to
10dfbef
Compare
liangyuanruo
approved these changes
Aug 17, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i made some suggestions so that the APIs can better reflect a domain-driven design.
mantariksh
force-pushed
the
bounce-coll
branch
from
August 18, 2020 02:50
52f84de
to
ae1bea0
Compare
mantariksh
force-pushed
the
bounce-coll
branch
from
August 18, 2020 06:13
ae1bea0
to
ef26de0
Compare
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
We do not have a reliable way of being alerted to critical bounces, i.e. email-mode forms where emails to all recipients are bouncing, resulting in lost responses. The current system (CloudWatch alarm if admin responses cross a certain threshold) does not discriminate by critical/non-critical bounces, and also allows critical bounces for low-volume forms to slip under the radar.
Closes #5
Solution
Create a Bounce collection to keep track of bounces per form, and activate CloudWatch alarms only for critical bounces. The collection was necessary because we need the data to persist across bounce notifications, since bounce notifications can arrive piecemeal (e.g. if there are 2 email recipients, SES might tell us that each recipient bounced in 2 separate notifications). The collection also helps us keep track of whether alarms have already been sent so that we can control the rate of alarms.
Documents in this collection have a 30min TTL so that we receive alarms every 30min as long as critical bounces are still happening for a given form.
Tests
Before release
hasBounced
is false for all of them.hasBounced
is set to true only for the invalid recipient.hasBounced
is set to true for all of them. Check CloudWatch alarms and ensure that the alarm called "Critical Bounces (Staging)" has triggered.BOUNCE_LIFE_SPAN
env var has been added in production and set to 1800000 (number of ms in 30min).After release
expireAt
in Bounce collection in production.