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.
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
Notifications: small fixes found after reviewer #10996
Notifications: small fixes found after reviewer #10996
Changes from 6 commits
bd1e101
fc9f1ca
6e3ae2c
a72a31e
b269562
2030e3d
24bd75d
6e7b0b4
68b669f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Since we have control over the notification, I think this should fail hard, our tests should catch these instead of silently failing.
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.
We can't catch this by tests since this rendering happens at runtime. This could happen because a
Notification
was created with invalid format values, or because we have change the message over time and started required more format values.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.
The idea here would be to test for each notification we generate on each part of the code base. If we generate a notification when the user does something, we should have a test for it.
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.
That's fine, we can test the current state, but it could fail still in the future:
body="Go to {url} and put {code}."
andformat_values={"url": "https://..", "code": 1234}
body="Go to {url} and put {code}. Otherwise, contact support at {email}
At this point, all the old notifications with only
url
andcode
as format values will start to fail because they are missing theemail
key. This check here is to protect ourselves against this issue.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.
We will find some edge cases as we go that we can improve and write test cases for them and protections like this one against them.