coralproject / talk

A better commenting experience from Vox Media
https://coralproject.net
Other
1.88k stars 355 forks source link

[CORL-3125]: increment and decrement notificationCount on comment rejection/approval #4567

Closed kabeaty closed 6 months ago

kabeaty commented 6 months ago

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?