When a comment is rejected, these changes check for any reply notifications for that comment and decrement the notification count for the relevant user if any are found (only decrement if user has no last seen notification date or one that is before the reply notification for the deleted comment). If a comment is rejected upon initial notification creation, we never decrement the user notification count. If a previously rejected comment is approved, then we want to increment the user count (only increment if user has no last seen notification date or one that is before the reply notification for the newly approved comment).
These changes will impact:
[x] commenters
[ ] moderators
[ ] admins
[ ] developers
What changes to the GraphQL/Database Schema does this PR introduce?
none
Does this PR introduce any new environment variables or feature flags?
no
If any indexes were added, were they added to INDEXES.md?
n/a
How do I test this PR?
You can test these changes by:
replying to a user's comments, with a window open on the stream for the user to whom you are replying. See their notification count increase
Go in and reject one of the replies. See that user's notification count decrease
If you submit a comment that is immediately rejected based on including a banned word, the notification count for the user never increments
approve a reply that you rejected. See that the notification count increments
Also check that these decrements/increments only happen when the user either has no last seen notification date or a last seen notification date that is before these reply notifications.
What does this PR do?
When a comment is rejected, these changes check for any reply notifications for that comment and decrement the notification count for the relevant user if any are found (only decrement if user has no last seen notification date or one that is before the reply notification for the deleted comment). If a comment is rejected upon initial notification creation, we never decrement the user notification count. If a previously rejected comment is approved, then we want to increment the user count (only increment if user has no last seen notification date or one that is before the reply notification for the newly approved comment).
These changes will impact:
What changes to the GraphQL/Database Schema does this PR introduce?
none
Does this PR introduce any new environment variables or feature flags?
no
If any indexes were added, were they added to
INDEXES.md
?n/a
How do I test this PR?
You can test these changes by:
Also check that these decrements/increments only happen when the user either has no last seen notification date or a last seen notification date that is before these reply notifications.
Were any tests migrated to React Testing Library?
How do we deploy this PR?